在A1中输入或复制粘贴此公式
=IF(COUNTA(B1:F1)=1,B1,IF(COUNTA(B1:F1)=2,B1&","&C1,IF(COUNTA(B1:F1)=3,B1&","&C1&","&D1,IF(COUNTA(B1:F1)=4,B1&","&C1&","&D1&","&E1,B1&","&C1&","&D1&","&E1&","&F1))))
=IF(COUNTA(B1:F1)=1,B1,IF(COUNTA(B1:F1)=2,B1&","&C1,IF(COUNTA(B1:F1)=3,B1&","&C1&","&D1,IF(COUNTA(B1:F1)=4,B1&","&C1&","&D1&","&E1,B1&","&C1&","&D1&","&E1&","&F1))))
下拉填充
第一个公式分隔符号是半角逗号,第二个是全角逗号。
A1:
=b1&","&c1&","&d1&","&e1&","&f1
下拉复制公式