1

I'll need a formula in excel to detect for example 1111; has three different products linked, meanwhile 2222 has only linked "oranges"

Here I left and example of my excel table:

Product ID Product Name
1111 Apples
1111 Orange
1111 Grapes
2222 Orange
3333 Apples
3333 Orange
3333 Grapes
4444 Orange

Hope it is clear!

Thanks in advance.

JoseCJ
  • 13
  • 3
  • concatenate them together then count. – Solar Mike Mar 10 '22 at 16:14
  • If i concatenate eg: 1111- Apple, 1111-Orange, 1111-Grapes and then i do a countIf it will throw a 1 in each row, Ill need a formula to give me the info that "product id" has 3,4....n products linked to it. Sry if i dont explain myself correctly. – JoseCJ Mar 10 '22 at 16:17
  • 1
    @JoseCJ Try using this formula, it shall give you the expected output `=COUNTIFS($A$2:$A2,A2,$B$2:$B2,"<>"&B2)+1` Assuming `A1` & `B1` is header, so place the formula in cell `C2` – Mayukh Bhattacharya Mar 10 '22 at 16:24
  • 1
    If column B contains unique values a count if on column A only would suffice even. – P.b Mar 10 '22 at 16:34
  • @JoseCJ just to make it look fancy you may use this as well, `="Product ID "&A2&"-Product Type No.-"&COUNTIFS($A$2:$A2,A2,$B$2:$B2,"<>"&B2)+1` – Mayukh Bhattacharya Mar 10 '22 at 16:39
  • 1
    Thx @MayukhBhattacharya trying i think its working must do some testing as B has duplicates values too, i explain my self i could have several 1111 - apples row. – JoseCJ Mar 10 '22 at 16:39
  • @JoseCJ so did you try the one as suggested ? Or do you need a screenshot for the example! – Mayukh Bhattacharya Mar 10 '22 at 16:41
  • 1
    @MayukhBhattacharya appreciate the screenshot if possible! – JoseCJ Mar 10 '22 at 16:46
  • @JoseCJ Done, I hope it makes sense, ! – Mayukh Bhattacharya Mar 10 '22 at 16:47

1 Answers1

0

Sharing just for clarity, refer image below,

• Formula used in cell C2

=COUNTIFS($A$2:$A2,A2,$B$2:$B2,"<>"&B2)+1

• Formula used in cell D2 --> You may use this as well or modify to make it look bit fancy

="Product ID "&A2&"-Product Type No.-"&COUNTIFS($A$2:$A2,A2,$B$2:$B2,"<>"&B2)+1

FORMULA_SOLUTION

Mayukh Bhattacharya
  • 12,541
  • 5
  • 21
  • 32