10 years experience working with Excel in multinational companies.
Please find below the formula that would help you format the data accordingly with your requirements: =IF(MOD(LEN(A2),5)>0,CONCATENATE(LEFT(A2,5),"-",MID(A2,LEN(LEFT(A2,5))+1,5),"-",RIGHT(A2,MOD(LEN(A2),5))),CONCATENATE(LEFT(A2,5),"-",MID(A2,LEN(LEFT(A2,5))+1,5)))