Reputation: 21
ABC-123 in 1 column and I need to have it show 123-ABC in another (for multiple rows and text), what's the best way to do it?
ABC-123
DEF-456
would like such sets of data to be copied to another colum, but reverse:
123-ABC
456-DEF
Upvotes: 2
Views: 207
Reputation: 46371
Assuming data in A2
then you can use this formula in B2
to swap the data before the hyphen with the data after, regardless of the length of each part
=MID(A2&"-"&A2,FIND("-",A2)+1,LEN(A2))
Upvotes: 5
Reputation: 46
Something similar to
=CONCATENATE(RIGHT(B24; FIND(" - ";B24)-1); " - "; LEFT(B24; FIND(" - ";B24)-1);)
my data was stored in B24
Upvotes: 0