Formula to Switch places

sakrams

Board Regular
Joined
Sep 28, 2009
Messages
59
Office Version
  1. 2016
Platform
  1. Windows
Good Afternoon Excel Gurus,

Need help from the gurus with a quick formula to achieve the following result. I have a lot of sheets to fix and all sheets have 1000's of rows.

Column A has tags starting with numbers and some starting with characters. I am trying to write a formula that can convert the tags starting with characters to switch as shown in the table below. If the tag is starting with numbers remain with no change in a new column. Is there a quick way of achieving that?

[TABLE="width: 276"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]0002654-STL[/TD]
[TD]0002654-STL[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]000322-ST[/TD]
[TD]000322-ST[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]0005-STM[/TD]
[TD]0005-STM[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]0012-STM[/TD]
[TD]0012-STM[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]0016-STM[/TD]
[TD]0016-STM[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]0019-STM[/TD]
[TD]0019-STM[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]0020-STL[/TD]
[TD]0020-STL[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]0020-STM[/TD]
[TD]0020-STM[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]0021-STL[/TD]
[TD]0021-STL[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]0021-STM[/TD]
[TD]0021-STM[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]0050-STL[/TD]
[TD]0050-STL[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]0075-STM[/TD]
[TD]0075-STM[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]0076-STM[/TD]
[TD]0076-STM[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]0078-STL[/TD]
[TD]0078-STL[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]STL-0001[/TD]
[TD]0001-STL[/TD]
[/TR]
[TR]
[TD]16[/TD]
[TD]STL-0005[/TD]
[TD]0005-STL[/TD]
[/TR]
[TR]
[TD]17[/TD]
[TD]STL-0010[/TD]
[TD]0010-STL[/TD]
[/TR]
[TR]
[TD]18[/TD]
[TD]STL-0011[/TD]
[TD]0011-STL[/TD]
[/TR]
[TR]
[TD]19[/TD]
[TD]STL-0013[/TD]
[TD]0013-STL[/TD]
[/TR]
[TR]
[TD]20[/TD]
[TD]STL-0014[/TD]
[TD]0014-STL[/TD]
[/TR]
[TR]
[TD]21[/TD]
[TD]STL-0016[/TD]
[TD]0016-STL[/TD]
[/TR]
[TR]
[TD]22[/TD]
[TD]STL-0017[/TD]
[TD]0017-STL[/TD]
[/TR]
[TR]
[TD]23[/TD]
[TD]SM-0004[/TD]
[TD]0004-SM[/TD]
[/TR]
[TR]
[TD]24[/TD]
[TD]S-0011[/TD]
[TD]0011-S[/TD]
[/TR]
[TR]
[TD]25[/TD]
[TD]STM-0013[/TD]
[TD]0013-STM[/TD]
[/TR]
[TR]
[TD]26[/TD]
[TD]STM-0015[/TD]
[TD]0015-STM[/TD]
[/TR]
[TR]
[TD]27[/TD]
[TD]STM-0054[/TD]
[TD]0054-STM[/TD]
[/TR]
[TR]
[TD]28[/TD]
[TD]STM-0055[/TD]
[TD]0055-STM[/TD]
[/TR]
[TR]
[TD]29[/TD]
[TD]STM-0057890[/TD]
[TD]0057890-STM[/TD]
[/TR]
[TR]
[TD]30[/TD]
[TD]STM-005877[/TD]
[TD]005877-STM[/TD]
[/TR]
[TR]
[TD]31[/TD]
[TD]SS-0001[/TD]
[TD]0001-SS[/TD]
[/TR]
[TR]
[TD]32[/TD]
[TD]STS-0004[/TD]
[TD]0004-STS[/TD]
[/TR]
[TR]
[TD]33[/TD]
[TD]STS-0006[/TD]
[TD]0006-STS[/TD]
[/TR]
[TR]
[TD]34[/TD]
[TD]STS-0007[/TD]
[TD]0007-STS[/TD]
[/TR]
[TR]
[TD]35[/TD]
[TD]STS-0008[/TD]
[TD]0008-STS[/TD]
[/TR]
</tbody>[/TABLE]
7JZK767t


7JZK767t
https://i.postimg.cc/prD4w5dv/SS.jpg

Thanks a million in advance.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Re: Help with a Formula to Switch places

Try this:

=IF(ISNUMBER(LEFT(A1)+0),A1,MID(A1&"-"&A1,FIND("-",A1)+1,LEN(A1)))
 
Upvote 0
Re: Help with a Formula to Switch places

Thanks for your help Phuoc, but this only returns "True"

Try this:

=IF(ISNUMBER(LEFT(A1)+0),A1,MID(A1&"-"&A1,FIND("-",A1)+1,LEN(A1)))
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top