Extract Number fron Cell

RobNSB

New Member
Joined
Jul 8, 2019
Messages
8
Office Version
  1. 365
Platform
  1. Windows
I am looking to extract a number form a cell as per the below examples:

The issue i have is the number of digits change. So I would be looking to extract the number between the last "x" and "ub" so in the first instance i would be looking to extract "147" and in the second instance I would be looking to extract "60".

Please help as I am going around in circles.

762×267×147 UB
406×178×60 UB
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
How about
+Fluff 1.xlsm
AB
1
2762×267×147 UB147
3406×178×60 UB60
Results
Cell Formulas
RangeFormula
B2:B3B2=TRIM(RIGHT(SUBSTITUTE(REPLACE(A2,LEN(A2)-2,3,""),CHAR(215),REPT(" ",100)),100))+0
 
Upvote 0
How about
+Fluff 1.xlsm
AB
1
2762×267×147 UB147
3406×178×60 UB60
Results
Cell Formulas
RangeFormula
B2:B3B2=TRIM(RIGHT(SUBSTITUTE(REPLACE(A2,LEN(A2)-2,3,""),CHAR(215),REPT(" ",100)),100))+0
Absolute genius, thank you very much!!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Another option might be (allowing for up to 5 digits in that final number but can be extended):

21 04 05.xlsm
AB
1
2762×267×147 UB147
3406×178×60 UB60
Extract Number
Cell Formulas
RangeFormula
B2:B3B2=AGGREGATE(14,6,RIGHT(LEFT(A2,LEN(A2)-3),{1,2,3,4,5})+0,1)
 
Upvote 0
Hi,

Just another way:

Book3.xlsx
AB
1762×267×147 UB147
2406×178×60 UB60
Sheet894
Cell Formulas
RangeFormula
B1:B2B1=RIGHT(SUBSTITUTE(LEFT(A1,LEN(A1)-3),CHAR(215),REPT(" ",30)),30)+0
 
Upvote 0
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Another option might be (allowing for up to 5 digits in that final number but can be extended):

21 04 05.xlsm
AB
1
2762×267×147 UB147
3406×178×60 UB60
Extract Number
Cell Formulas
RangeFormula
B2:B3B2=AGGREGATE(14,6,RIGHT(LEFT(A2,LEN(A2)-3),{1,2,3,4,5})+0,1)
Thank you, your help is very much appreciated.
 
Upvote 0
Hi,

Just another way:

Book3.xlsx
AB
1762×267×147 UB147
2406×178×60 UB60
Sheet894
Cell Formulas
RangeFormula
B1:B2B1=RIGHT(SUBSTITUTE(LEFT(A1,LEN(A1)-3),CHAR(215),REPT(" ",30)),30)+0
Thank you, your help is very much appreciated.
 
Upvote 0

Forum statistics

Threads
1,215,647
Messages
6,126,006
Members
449,280
Latest member
Miahr

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