ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Look Up with Multiple Conditions (https://www.excelbanter.com/excel-discussion-misc-queries/446690-look-up-multiple-conditions.html)

Excel Dumbo

Look Up with Multiple Conditions
 
1 Attachment(s)
Hello,

Could you please help me with a formula to lookup data based on multiple variables ? Please see attached

Thanks

Excel Dumbo

Spencer101

Quote:

Originally Posted by Excel Dumbo (Post 1604060)
Hello,

Could you please help me with a formula to lookup data based on multiple variables ? Please see attached

Thanks

Excel Dumbo

Hi,

I'm not sure from your example what it is you're trying to achieve.

Could you explain a little more?

Dave O

Look Up with Multiple Conditions
 
One possible answer:
=SUMPRODUCT(--($B$1=Data!$A$4:$A$21),--($A3=Data!$B$4:$B$21),Data!$C$4:$C$21)
....where Data!$c$4:$c$21 represents the column of numbers to be summed. To capture the July information you'd need to change this to Data!$d$4:$d$21.

This answer uses the double unary operator, indicated by the -- in the formula. In the context of SUMPRODUCT, the double unary operator checks a given column for a match, as in --($B$1=Data!$A$4:$A$21); where there is a match it applies a 1 to the multiplication, and where there is a mismatch it applies 0. If a row matches all the specified conditions, SUMPRODUCT multiplies 1 x 1 x N. If any condition mismatches the 0 multiplier yields a 0 in the sum.

Excel Dumbo

Thanks Dave. This is what I was looking for


All times are GMT +1. The time now is 04:44 PM.

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