Falcon4ch
Falcon4ch

Reputation: 120

How can I return a lookup value from a third column from a reference value in two cells?

I have an excel file with two sheets. I'm trying to reference one sheet's numbers based on text using a formula in the other sheet. I have one sheet that looks something like this -

Sheet 1

And another that looks like this -

Sheet 2

I would like to put a formula on the first sheet that basically says - look on the second sheet for the values in columns A and B and return me the value in column C. The tricky part is - the values in the first sheet may be inverted or there may be an instance where only one value is present, like in row 1 in the first sheet. Also the formula should only fill in a value if both columns match. All text combinations in Sheet 2 are unique.

So for example - on the first sheet the formula should return 1 in cell C1, 5 in cell C4, and would error in the other 2 cells.

I hope that wasn't too confusing. I would greatly appreciate any help you can give.

Thank you!

Upvotes: 0

Views: 56

Answers (1)

Scott Craner
Scott Craner

Reputation: 152660

Add two sumifs together:

=SUMIFS(G:G,E:E,IF(A1="","",A1),F:F,IF(B1="","",B1))+SUMIFS(G:G,F:F,IF(A1="","",A1),E:E,IF(B1="","",B1))

enter image description here

Upvotes: 1

Related Questions