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

jmpatrick

Active Member
Joined
Aug 17, 2016
Messages
485
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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
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,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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