What should be the excel VLOOKUP formula?

Viewed 41

If in the table array used in VLOOKUP formula, there are two columns: ID and Paid

The data given in the table array are as follows:

ID Paid
A NaN
A NaN
B YES
C NaN
B NaN
C NaN
A YES

What should be the EXCEL formula to get

A -> YES

B -> YES

C -> NaN

LOGIC: For any ID if the PAID column is has at least one YES the VLOOKUP result should be YES, if the ID does not have at least one YES the VLOOKUP result should be NaN for that ID

1 Answers

Use IF and COUNTIFS:

=IF(COUNTIFS(A:A,D2,B:B,"YES"),"YES","NaN")

enter image description here

Related