HelloWorld
HelloWorld

Reputation: 111

How to find first unique value in a column of SKU?

So I have two columns, A & B, (like below). There's 2 components to the ID, the design (CEN101A) and the size (-6).

I'm trying find the first item of each design. So in this example, I would highlight (CEN106A-6, CEN101B-6, CEN101D-6, etc.). This is so I can use them as a parent for the other sizes.

I've tried many in-built functions but nothing seems to work. Is VBA able to easily find these values?

enter image description here

Upvotes: 0

Views: 205

Answers (1)

JvdV
JvdV

Reputation: 75930

@BigBen is right, this is fairly easy if you can find what the actual design code is. For good measure I'd use a running count and add the hyphen back including a wildcard into the COUNTIF():

enter image description here

Formula for conditional formatting rule on range A2:A7:

=COUNTIF(A$2:A2,@TEXTSPLIT(A2,"-")&"-*")=1

Without TEXTSPLIT(), use a combo of LEFT() and FIND() as per the comment by @P.b:

=COUNTIF(A$2:A2,LEFT(A2,FIND("-",A2))&"*")=1

Upvotes: 2

Related Questions