Adding "remove non-numerals" to my fabulous formula?

jmpatrick

Active Member
Joined
Aug 17, 2016
Messages
482
Office Version
  1. 365
Platform
  1. Windows
Happy Halloween!

I have this not-so-spooky formula that takes the value of Column C and returns everything to the right of the dash:

Excel Formula:
=RIGHT(C785,LEN(C785)-SEARCH("$",SUBSTITUTE(C785,"-","$",LEN(C785)-LEN(SUBSTITUTE(C785,"-","")))))

7073M-5B becomes 5B. How do I remove all non-numerals so it returns just 5?

jp
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hello, one way could be:

Excel Formula:
=--(TEXTJOIN("",1,TEXTSPLIT(TEXTAFTER(C785,"-",-1),CHAR(VSTACK(SEQUENCE(47,,1),SEQUENCE(198,,58))))))
 
Upvote 0
Solution
Another option along with that offered by @hagia_sofia . I don't see any issues with copying the formula down.
MrExcel_20241030.xlsx
ABC
370-73M-5B6 5656
470-73M-75B6 756756
570-73M-89 8989
Sheet3
Cell Formulas
RangeFormula
B3:B5B3=LET(t,TEXTAFTER(A3,"-",-1),TEXTJOIN("",1,IFERROR(MID(t,SEQUENCE(LEN(t)),1)+0,""))+0)
C3:C5C3=--(TEXTJOIN("",1,TEXTSPLIT(TEXTAFTER(A3,"-",-1),CHAR(VSTACK(SEQUENCE(47,,1),SEQUENCE(198,,58))))))
 
Upvote 0
Another option along with that offered by @hagia_sofia . I don't see any issues with copying the formula down.
MrExcel_20241030.xlsx
ABC
370-73M-5B6 5656
470-73M-75B6 756756
570-73M-89 8989
Sheet3
Cell Formulas
RangeFormula
B3:B5B3=LET(t,TEXTAFTER(A3,"-",-1),TEXTJOIN("",1,IFERROR(MID(t,SEQUENCE(LEN(t)),1)+0,""))+0)
C3:C5C3=--(TEXTJOIN("",1,TEXTSPLIT(TEXTAFTER(A3,"-",-1),CHAR(VSTACK(SEQUENCE(47,,1),SEQUENCE(198,,58))))))

It works! My issue was with values that didn't include a dash. I added an IFERROR that solved it. Thanks to both!
 
Upvote 0

Forum statistics

Threads
1,223,604
Messages
6,173,320
Members
452,510
Latest member
RCan29

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