ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Trying to lookup based on a condition of two values (https://www.excelbanter.com/excel-worksheet-functions/265094-trying-lookup-based-condition-two-values.html)

Trying to lookup based on a condition of

Trying to lookup based on a condition of two values
 
I have three columns A, B and C.

I want too look up the value in C where A and B match different values.

Example:

A, B ,C
apple, color, green
apple , price, 30
lemon, taste, tangy
lemon, price 20

I want to lookup A=apple B=price to return the price 30.

T. Valko

Trying to lookup based on a condition of two values
 
Assuming that the combination of A + B is unique...

=SUMPRODUCT(--(A2:A10="apple"),--(B2:B10="price"),C2:C10)

Better to use cells to hold the criteria.

E2 = apple
F2 = price

=SUMPRODUCT(--(A2:A10=E2),--(B2:B10=F2),C2:C10)

--
Biff
Microsoft Excel MVP


"Trying to lookup based on a condition of" <Trying to lookup based on a
condition wrote in message
...
I have three columns A, B and C.

I want too look up the value in C where A and B match different values.

Example:

A, B ,C
apple, color, green
apple , price, 30
lemon, taste, tangy
lemon, price 20

I want to lookup A=apple B=price to return the price 30.





All times are GMT +1. The time now is 01:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com