View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Multiple "lookup_value"


Harlan,
One of the many things I didn't know - glad you posted it.

One, maybe obvious, comment is that in the case of duplicate entries the
SumProduct formula returns the sum of the duplicates (an incorrect answer),
while the Database function returns an error value.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"Harlan Grove"
wrote in message
"Sandy Mann" wrote...
Try:
=SUMPRODUCT((A2:A7="Apple")*(B2:B7="m")*(C2:C7=2) *D2:D7)

....
I'm not a purist about separating all terms in SUMPRODUCT, but there's some
value in separating the values summed from the criteria, so

=SUMPRODUCT((A2:A7="Apple")*(B2:B7="m")*(C2:C7=2), D2:D7)

just in case D2:D7 contained anything that wasn't numeric. The conditions
don't require such treatment because Excel can compare numbers, text and
boolean values without returning errors.