Abulalia
Abulalia

Reputation: 59

How to select a value given a set of criteria

I have the following table and would like to select the $ for products when index = max:

id     product     $      max?
1         A        1       No
2         B        2       No
3         A        2       No
4         C        4       No
5         D        5       No
6         A        3       Yes
7         B        6       Yes
8         C        8       Yes

How do I get the results in the column identified max?

Regards.

Upvotes: 1

Views: 56

Answers (1)

Dmitry Pavliv
Dmitry Pavliv

Reputation: 35843

UPD:

The results should be based on the max id and not max $. I am sorry for the confusion

If you need formula for max column based on max id, try next one:

=IF(MAX(IF(B:B=B2,A:A))=A2,"Yes","No")

where B:B column with your products, A:A - column with id.

Just select D2, enter formula in formula bar, and press CTRL+SHIFT+ENTER to evaluate it and then drag it down.

Note, if you know exact ranges of your data, you can change B:B and A:A to e.g. $B$2:$B$100 and $A$2:$A$100

Upvotes: 2

Related Questions