Extract number from the right of the string

sebastriantran

New Member
Joined
Sep 19, 2014
Messages
31
HI there,

I wonder if there is any way that we can extract number from the right of a string, for example:

ABC123 => 123
ABCD$DE%34 => 34

Thank you very much!
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
In a simpler case, If the delimiter is defined, for example the "$", is there an easy way to extract the number?

For instance:

=Tickmarks!$A$3 => 3
'=Tickmarks!$ABC$32323 =>32323
=Tickmarks!A17 => 17
Where is the $ sign in that last one?
 
Upvote 0
Yes, that's my typo, it should be $ sign instead of ! sign. I use the Instr and Left function to extract the number, but I wonder if there is any easier way to do it :D

Oh, this is a VB question. Okay, assuming cell A1 for example purposes...

Code:
 Number = Mid(Range("A1").Value, InStrRev(Range("A1").Value, "$") + 1)
 
Upvote 0

Forum statistics

Threads
1,213,510
Messages
6,114,034
Members
448,543
Latest member
MartinLarkin

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