CONCATENATE and TEXTJOIN formulas / Excel / VBA

荒凉一梦 提交于 2019-12-08 08:40:30

This is the Textjoin function you're looking for:

 =TEXTJOIN("-",TRUE,INDIRECT(MID(H2,1,1)&ROW(H2)),INDIRECT(MID(H2,2,1)&ROW(H2)),INDIRECT(MID(H2,3,1)&ROW(H2)),INDIRECT(MID(H2,4,1)&ROW(H2)),INDIRECT(MID(H2,5,1)&ROW(H2)),INDIRECT(MID(H2,6,1)&ROW(H2)),INDIRECT(MID(H2,7,1)&ROW(H2)))

Alongside Mister 832 great answer, here is a (possible) alternative solution for those who don't have Excel 2016 Textjoin function.

=SUBSTITUTE(INDIRECT(MID(H2;1;1)&ROW(H2))&" "&INDIRECT(MID(H2;2;1)&ROW(H2))&" "&INDIRECT(MID(H2;3;1)&ROW(H2))&" "&INDIRECT(MID(H2;4;1)&ROW(H2))&" "&INDIRECT(MID(H2;5;1)&ROW(H2))&" "&INDIRECT(MID(H2;6;1)&ROW(H2))&" "&INDIRECT(MID(H2;7;1)&ROW(H2));"  ";" ")
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!