是否有不使用宏或脚本的方法来获得此结果?
Bus Line L1 L2 L3 L4 Result
Stops
1 X X L2,L4
2 X L4
3 X X L1,L3
我需要为行上的每个“X”连接COLUMN'S NAME。
答案 0 :(得分:0)
使用TEXTJOIN()的数组版本
=TEXTJOIN(",",TRUE,IF(B2:E2="x",$B$1:$E1,""))
作为数组公式,需要在退出编辑模式时使用Ctrl-Shift-enter而不是Enter确认。
您也可以使用帮助列。在H2中:
=IF(B2="X","," &B$1,"")
拖动4列并向下拖动数据长度。
然后在F2中:
=MID(H2&I2&J2&K2,2,99)
另一个选项是结合上述两个步骤的长公式:
=MID(IF(B2="X","," &B$1,"")&IF(C2="X","," &C$1,"")&IF(D2="X","," &D$1,"")&IF(E2="X","," &E$1,""),2,99)
答案 1 :(得分:0)