Bob
Bob

Reputation: 1

Matching 2 columns with 2 others columns to return a value from another column

I have an issue I'm trying to fix in excel. I want to create an automation with the following logic: -Lookup each value from column H and I -If they match the values in column A and B respectively -Return the value in C to column J.

** Basically, IF(((H=A) AND (I=B)) THEN (return C in J)) **** How is that possible?

Upvotes: 0

Views: 47

Answers (2)

Scott Craner
Scott Craner

Reputation: 152450

In J2 this array formula:

=INDEX($C$2:$C$100,MATCH(H2 & "|" & I2,$A$2:$A$100 & "|" & $B$2:$B$100,0))

Being an array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode. If done correctly Excel will put {} around the formula.

So enter in J2. Hit Ctrl-Shift-Enter. Then copy down.

Upvotes: 1

Tim Williams
Tim Williams

Reputation: 166146

In J2:

=IF(AND(H2=A2, I2=B2), C2, "")

Upvotes: 1

Related Questions