1

I am trying to return the data of a third column when two columns match. For instance, column 1 would be "First Name" and column 2 would be "Last Name" with column 3 being their favorite color. I tried the following as an array with no success:

{=if(and($A$1:$A$50=D2,$B$1:$B$50=E2),$C$1:$C$50,"")}

I only need the first time that column A and column B match. Ultimately, this is like Vlookup with 2 variables.

D2 and E2 are the names to match.

Can this be done?

Pang
  • 9,564
  • 146
  • 81
  • 122
Molson1020
  • 13
  • 2
  • Possible duplicate of [Vlookup using 2 columns to reference another](https://stackoverflow.com/questions/42492758/vlookup-using-2-columns-to-reference-another) – girlvsdata Aug 13 '18 at 01:41

1 Answers1

0

Try the following formula, which needs to be confirmed with CONTROL+SHIFT+ENTER...

=INDEX($C$1:$C$50,MATCH(1,IF($A$1:$A$50=D2,IF($B$1:$B$50=E2,1)),0))
Domenic
  • 7,844
  • 2
  • 9
  • 17