Insert Charters into a number string vba or formula?

irrefutable14

New Member
Joined
Mar 2, 2017
Messages
25
I'd like to update a string of numbers and add charters before each string of numbers. IE

006-01-00-00
R006-B01-S00-P00
006-01-01-00
R006-B01-S01-P00

<tbody>
</tbody>

:confused:
 

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Gerald Higgins

Well-known Member
Joined
Mar 26, 2007
Messages
9,115
If your inputs are always text strings in exactly the format 000-00-00-00 and the characters to be inserted are always R, B, S, P in exactly those positions, then you can do it like this

="R"&left(a1,4)&"B"&mid(a1,5,3)...and so on.

If there is more variety to your situation, you'll need something more complicated.
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,122,193
Messages
5,594,774
Members
413,934
Latest member
austinb

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
Top