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.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Are you looking for "PLM123-ABC"?

=IFERROR(INDEX(I:I,MATCH(TEXTJOIN("",TRUE,IF(ISERROR(MID(LEFT(A1,FIND("-",A1)-1),SEQUENCE(100),1)+0),MID(LEFT(A1,FIND("-",A1)-1),SEQUENCE(100),1),"")),H:H,0),1),5)
 
Upvote 0
Hi and thank you for the reply.

For PLM123-ABC . I would be looking for the category it belongs to. Using the chart above, which would be 1.

Another examples would be: I am looking for the category...

1620868845001.png
 
Upvote 0
Sorry, I was just asking if the brackets were included. Did you try the formula?

*Just change A1 to the location you are looking in, looks like M3
 
Upvote 0
Hi. .....the part # is actually in column H.
The table listing the parts and categories..is on the lookups tab. column F .(vs column H shown above)

so i changed your A's to H's and the H:H to lookups!F:F...

=IFERROR(INDEX(I:I,MATCH(TEXTJOIN("",TRUE,IF(ISERROR(MID(LEFT(H1,FIND("-",H1)-1),SEQUENCE(100),1)+0),MID(LEFT(H1,FIND("-",H1)-1),SEQUENCE(100),1),"")),lookups!F:F,0),1),5)

My result is 5 no matter what the part # starts with. Sorry - maybe i'm missing something.
 
Upvote 0
=IFERROR(INDEX(I:I,MATCH(TEXTJOIN("",TRUE,IF(ISERROR(MID(LEFT(A1,FIND("-",A1)-1),SEQUENCE(100),1)+0),MID(LEFT(A1,FIND("-",A1)-1),SEQUENCE(100),1),"")),H:H,0),1),5)

H:H is the "part" lookup column
I:I is the Category
A1 is the part you are looking for
 
Upvote 0
Here is what I have....

=IFERROR(INDEX(lookups!G:lookups!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:lookups!F,0),1),5)

lookups tab - lists the table..... column F has the part # - column G has the category
on the main tab... the parts i am trying to find the category are..in column H...

Sorry for the confusion.

is the different tab throwing the formula off?
 
Upvote 0
if i have the lookup table on the same tab...your formula works!!
Can i have the lookup table on a different tab?
 
Upvote 0

Forum statistics

Threads
1,224,814
Messages
6,181,125
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