最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin4浏览0评论

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?

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?

Share Improve this question edited 2 days ago Mayukh Bhattacharya 27.8k8 gold badges29 silver badges42 bronze badges asked 2 days ago Ricardo PorroRicardo Porro 132 bronze badges New contributor Ricardo Porro is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct. 2
  • 1 Please clearly include some example data and the desired output. – DBS Commented 2 days ago
  • What version of Excel do you have? – BigBen Commented 2 days ago
Add a comment  | 

2 Answers 2

Reset to default 4

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))
  • Split the strings using TEXTSPLIT() where the delimiter is a comma,

  • Use MAP() function to execute a custom LAMBDA() function to split by every 2 characters and then join again by a colon,

  • Finally, using ARRAYTOTEXT() to concatenate the strings into one.


By comms (,) I am assuming they are in rows. If not, refer to Mayukh's answer

You can use TEXTJOIN function, which takes text split using MID function. Since the MAC addresses have fixed size, it would be easier to split function

=TEXTJOIN(":", TRUE, MID(A2, {1,3,5,7,9,11},2))

Here A2 is the source column.

发布评论

评论列表(0)

  1. 暂无评论