Reformatting MAC addresses in Excel

Today, a customer asked me to add his 150 phone’s MAC address to their MAB Bypass database they use for 802.1x. The customer game me the output from an Excel spreadsheet that contained the MAC addresses but without the “-“ in it. I needed to get it in the 01-11-11-11-10-00 format.

Here is the Excel formula:


Here is how it works. Take a look at the example MAC addres (Picture below). You can see that the MAC address is a 12 character line.


Explanation of Formula:
=MID (text, start_num, num_chars)&”-“

Excerpt from my formula:
What this says is: start at the 1st character ‘0’ and move ‘2’ characters over ‘&’ add a ‘-‘

If you were to leave this formula the way it is, you would have the following output:

However, we added another ‘&’ and another sub formula ‘MID(A2,3,2)&”-“‘

The above section will start at position ‘3’ and move 2 characters over. Then it will add a ‘-‘ after the 5th character (3+2).

We then repeat the same operation with 5,7,9,and 11, adding a ‘-‘ between each except for the last one (11).


The screenshot above shows the final output.


Leave a Reply

Your email address will not be published. Required fields are marked *