Excel - Parse Data and Categorize Based On Criteria

santa12345

Board Regular
Joined
Dec 2, 2020
Messages
70
Office Version
  1. 365
Platform
  1. Windows
Hello.
I am trying to do the following:

I have a part numbers listed in Column A. Based on how the part number starts, I want to categorize it appropriately.

Based on the following:

1620859057209.png


A1 = has part # (PLM123-ABC)
I want B1 to return 1 (for the category)

A2 = has part # (ABC-123-XYZ)
I want B2 to return 5 (for the category)

Is there a way to do this ?

Thank you for your time and advanced input.
 
close, different tab is fine

=IFERROR(INDEX(Lookups!G:G,MATCH(TEXTJOIN("",TRUE,IF(ISERROR(MID(LEFT(H2,FIND("-",H2)-1),SEQUENCE(100),1)+0),MID(LEFT(H2,FIND("-",H2)-1),SEQUENCE(100),1),"")),Lookups!F:F,0),1),5)
 
Upvote 0

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.
And lastly..and unfortunately some of these parts don't have a "-" after the first few characters.
So this part...
SB38 X 12 X 8.000IN comes back with a 5. instead of a 1. as a category.
I think because there is no "-"

Wondering if the formula could be changed to only include the first 2 characters.
 
Upvote 0
Sure

=IFERROR(INDEX(lookups!G:G,MATCH(TEXTJOIN("",TRUE,IF(ISERROR(MID(LEFT(H2,2),SEQUENCE(100),1)+0),MID(LEFT(H2,2),SEQUENCE(100),1),"")),lookups!F:F,0),1),5)

*just make sure you change the lookups to also be just 2 characters
 
Upvote 0

Forum statistics

Threads
1,223,891
Messages
6,175,229
Members
452,621
Latest member
Laura_PinksBTHFT

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