Formula to remove just numeric values.

phillipc1

New Member
Joined
Oct 11, 2023
Messages
20
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I am working on a way to extract just the numeric values from an email address as this numeric value is a unique employee ID. I have an example below of what I would like to do, I just can't figure out the best formula to achieve this. All of the values will be presented in the same exact format with the exception being the exact amount of numeric values listed.

Data examples provided:
d12345@genericemail.com
d1234@genericemail.com
d123456@genericemail.com
d12@genericemail.com

Outputs needed:
12345
1234
123456
12

I tried using a mid function, but was not sure if this would work or if I input it correctly as it was still providing an error.

Code:
=MID('G16,SEARCH("d",G16)+1,SEARCH("d",G16,SEARCH("d",G16)+1)-SEARCH("@",G16)-1)

I appreciate any assistance that can be provided in figuring this out.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
How about
Fluff.xlsm
AB
1
2d12345@genericemail.com12345
3d1234@genericemail.com1234
4d123456@genericemail.com123456
5d12@genericemail.com12
Sheet5
Cell Formulas
RangeFormula
B2:B5B2=CONCAT(TEXTSPLIT(UPPER(A2),CHAR(SEQUENCE(27,,64)),".",1))
 
Upvote 0
How about
Fluff.xlsm
AB
1
2d12345@genericemail.com12345
3d1234@genericemail.com1234
4d123456@genericemail.com123456
5d12@genericemail.com12
Sheet5
Cell Formulas
RangeFormula
B2:B5B2=CONCAT(TEXTSPLIT(UPPER(A2),CHAR(SEQUENCE(27,,64)),".",1))
It looks like this worked out! Just as another thought, it is possible for blanks to occur at which point I would want to return blank as opposed to "#VALUE". For that case, should I add an if(isblank( like below?

Excel Formula:
=IF(ISBLANK(A2),"",CONCAT(TEXTSPLIT(UPPER(A2),CHAR(SEQUENCE(27,,64)),".",1)))
 
Upvote 0
Hello all,

I am working on a way to extract just the numeric values from an email address as this numeric value is a unique employee ID. I have an example below of what I would like to do, I just can't figure out the best formula to achieve this. All of the values will be presented in the same exact format with the exception being the exact amount of numeric values listed.

Data examples provided:
d12345@genericemail.com
d1234@genericemail.com
d123456@genericemail.com
d12@genericemail.com

Outputs needed:
12345
1234
123456
12

I tried using a mid function, but was not sure if this would work or if I input it correctly as it was still providing an error.

Code:
=MID('G16,SEARCH("d",G16)+1,SEARCH("d",G16,SEARCH("d",G16)+1)-SEARCH("@",G16)-1)

I appreciate any assistance that can be provided in figuring this out.
Try doing this:

VBA Code:
=SUBSTITUTE(SUBSTITUTE(MID(G16,MIN(IF(ISNUMBER(--MID(G16,ROW(INDIRECT("1:" & LEN(G16))),1)),ROW(INDIRECT("1:" & LEN(G16))),""),IF(ISNUMBER(--MID(G16,ROW(INDIRECT("1:" & LEN(G16))),1)),ROW(INDIRECT("1:" & LEN(G16))),"")), "@genericemail.com", "")
 
Upvote 0
Often best to avoid ISBLANK and do it like
Excel Formula:
=IF(A2="","",CONCAT(TEXTSPLIT(UPPER(A2),CHAR(SEQUENCE(27,,64)),".",1)))
 
Upvote 0
Solution
Glad we could help & thanks for the feedback.
 
Upvote 0
Because a cell that contains a formula returning "" is not a blank cell & catches a lot of people out.
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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