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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
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,904
Messages
6,175,295
Members
452,632
Latest member
jladair

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