Mr. Donald J. Trump

Trump, Mr. Donald J.

\s\w+\z

I'm trying to transpose last name first. likeCode: [Select]Mr. Donald J. Trump to Code: [Select]Trump, Mr. Donald J.seems excel doesn't have a good way to identify "last" though regex should be able to Code: [Select]\s\w+\z but not managing to get that fit into the rest of the codeworked something out. replaced \z with $ and used multiple columns to concatenate as needed

=regexreplace(A2,"(.*) (\w*)","$2, $1")

Mr. Donald J. Trump Mr. Donald J. Trump

With regex there's pretty much always a way Code: [Select]=regexreplace(A2,"(.*) (\w*)","$2, $1")

The trick is to concatenate 2 strings together Code: [Select]Mr. Donald J. Trump Mr. Donald J. Trump then work from there removing until the second period and the last word etc.

Why not just use the right () function, & the select left() - count(right())?Could be I mentioned the wrong function to count the letters, haven't done it for some time.

I've done it that way, but regex is simpler (once you know how to use it) since you don't need to fuss with nested functions.

What's regex?

Does anyone know a formula to reverse the order of text within a cell?EG: the text TCRVO is אברהם in hebrew but I have it written in excel as OVRCT so is there any way to reverse the order?TIA

You can try this: https://superuser.com/questions/121618/any-excel-function-that-will-reverse-a-stringThe second answer looks better than the first.

=IF(LEN(A1)<1,"",MID(A1,LEN(A1),1))&IF(LEN(A1)<2,"",MID(A1,LEN(A1)-1,1))&IF(LEN(A1)<3,"",MID(A1,LEN(A1)-2,1))&IF(LEN(A1)<4,"",MID(A1,LEN(A1)-3,1))&IF(LEN(A1)<5,"",MID(A1,LEN(A1)-4,1))&IF(LEN(A1)<6,"",MID(A1,LEN(A1)-5,1))&IF(LEN(A1)<7,"",MID(A1,LEN(A1)-6,1))&IF(LEN(A1)<8,"",MID(A1,LEN(A1)-7,1))&IF(LEN(A1)<9,"",MID(A1,LEN(A1)-8,1))&IF(LEN(A1)<10,"",MID(A1,LEN(A1)-9,1))&IF(LEN(A1)<11,"",MID(A1,LEN(A1)-10,1))&IF(LEN(A1)<12,"",MID(A1,LEN(A1)-11,1))&IF(LEN(A1)<13,"",MID(A1,LEN(A1)-12,1))&IF(LEN(A1)<14,"",MID(A1,LEN(A1)-13,1))&IF(LEN(A1)<15,"",MID(A1,LEN(A1)-14,1))&IF(LEN(A1)<16,"",MID(A1,LEN(A1)-15,1))&IF(LEN(A1)<17,"",MID(A1,LEN(A1)-16,1))&IF(LEN(A1)<18,"",MID(A1,LEN(A1)-17,1))&IF(LEN(A1)<19,"",MID(A1,LEN(A1)-18,1))&IF(LEN(A1)<20,"",MID(A1,LEN(A1)-19,1))&IF(LEN(A1)<21,"",MID(A1,LEN(A1)-20,1))&IF(LEN(A1)<22,"",MID(A1,LEN(A1)-21,1))&IF(LEN(A1)<23,"",MID(A1,LEN(A1)-22,1))&IF(LEN(A1)<24,"",MID(A1,LEN(A1)-23,1))&IF(LEN(A1)<25,"",MID(A1,LEN(A1)-24,1))&IF(LEN(A1)<26,"",MID(A1,LEN(A1)-25,1))

Thanks, I found that as well just now but over here: https://www.extendoffice.com/documents/excel/1146-excel-reverse-string-word-order.html#a1So far so good.

I would like to move every second row to column B and every 3rd row to column C.Anyway to do do it ?