Extract text from an alpha numeric value

aquad6

New Member
Joined
Jun 23, 2023
Messages
10
Office Version
  1. 365
Platform
  1. MacOS
Hey there!!
I am looking for a formula that will extract the base Sku from a value to the right of a cell. For example If I type MON345CD in Cell B1, I would like A1 to Populate with MON345, or if it is MON345A I need it to populate A1 with MON345. Some of my skus have one letter at the end, some have multiple letters at the end. I need it to extract the text before the alpha characters after the last numeric character. Thank you!!
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Give this formula a try...
Excel Formula:
=LEFT(B1,1+LEN(TEXTBEFORE(B1,SEQUENCE(10,,0),-1)))
 
Upvote 0
Solution
This worked perfect! Could you tell me how to put an if error formula to hide the #Value?
Maybe just try wrapping it in an IFERROR formula, i.e.
Rich (BB code):
=IFERROR(LEFT(B1,1+LEN(TEXTBEFORE(B1,SEQUENCE(10,,0),-1))),"")
 
Upvote 0
You are welcome.
Glad we were able to help.

Please note that when marking a post as the solution, you should mark the original post containing the solution, not your own psot acknowledging that another post was the solution.
I have made the update for you on this thread.
 
Upvote 0
Hey there!!
I am looking for a formula that will extract the base Sku from a value to the right of a cell. For example If I type MON345CD in Cell B1, I would like A1 to Populate with MON345, or if it is MON345A I need it to populate A1 with MON345. Some of my skus have one letter at the end, some have multiple letters at the end. I need it to extract the text before the alpha characters after the last numeric character. Thank you!!
If it is always about the first 6 characters, then it would be simpler:
=LEFT(B1, 6)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
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