View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
JW[_2_] JW[_2_] is offline
external usenet poster
 
Posts: 638
Default If and then statement to sum corresponding prices.

Bernard, sumproduct would certainly be more effecient than the array
formula I posted. I'm assuming that you meant to have a colon between
F3 and F32 instead of a comma.
=SUMPRODUCT(--(B3:B32="David"),--(C3:C32="Christmas"),F3:F32)

Regards,
-Jeff-

Bernard Liengme wrote:
IF is not the one to use. Use:
SUMPRODUCT(--(B3:B32="David"),--(D3:D32="Birthday"),F3,F32)
For more details see
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
http://mcgimpsey.com/excel/formulae/doubleneg.html
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"Doo0592" wrote in message
oups.com...
Hi all,

I am trying to set up a worksheet that will calculate up how much
money I'm spending on people for thier christmas and birthdays this
year (unfortunately they all come at once!). The english version of
the formula I'm am trying to write is

IF B3:B32 = "David" AND D3:D32= "Birthday" THEN K4 = sum of
corresponding price in F3:F32.

I have to admit I'm not very good with If and then statements but I
understand the basics of programming.