Extracting and Formatting Numbers from Data Rows

TheWes

New Member
Joined
Sep 20, 2024
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
Hi guys,

I need some help please.

I have many rows of data that look like this:


Raw code
18G4007
18G4008
18G4009
18G7980
18M18
18R4000
18R912

I would like to extract the numbers from the right until the alphabetic letter.
I want the extracted numbers to always be 4 digits. If there are only 2 or 3 digits before the alphabetic letter, I’d like to add 1 or 2 zeros in front, respectively.
To summarize, I’m looking for a solution that can transform the raw input:


Raw code
18G4007
18G4008
18G4009
18G7980
18M18
18R4000
18R912

New code
4007
4008
4009
7980
0018
4000
0912

Any guidance or syntax in Excel to achieve this would be greatly appreciated!

Thanks in advance!
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Bảng-kê-doanh-thu-chi-phí-T10.2024.xlsx
AB
1046U429646
1147M4747
124D10004
134D39204
Sheet1
Cell Formulas
RangeFormula
B10:B13B10=RIGHT("00"&AGGREGATE(14,6,LEFT(A10,{1,2,3,4})+0,1),2)
 
Upvote 0
Solution
Thank you, great solution, I need to look into the aggregate function but this for sure works. Thanks.
 
Upvote 0

Forum statistics

Threads
1,222,605
Messages
6,167,024
Members
452,091
Latest member
Jiraya_00

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