excelexcel-formula

How can I add the colon to a list of MAC addresses in an excel sheet that has several MACs in one cell?


I have an excel with several MAC addresses and I need to add the colon to them. All cells have multiple MACs. For ex. XXXXXXXXXXXX, XXXXXXXXXXXX, XXXXXXXXXXXX. They are split by commas.

Is there a way to do it without splitting the MACs into its own cells?


Solution

  • Maybe you could try something like this:

    =LET(
         a, TEXTSPLIT(E2,", "),
         b, MAP(a, LAMBDA(b, TEXTJOIN(":",,MID(b,SEQUENCE(6)*2-1,2)))),
         ARRAYTOTEXT(b))