View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Darren Darren is offline
external usenet poster
 
Posts: 137
Default Problems with sum + if

Actually, what I'd like to do is sum all the cells down column b whose
corresponding rows satisfy the three conditions described in the formulas I
have been trying to use.

Basically, column b has quantities of a certain product ("SEP06MAR07"
condition) bought or sold ("S" condition) at a certain price (-12.5
condition) and that information is contained in the same row as the cell I
want to evaluate to be summed all the way down the database. So, something
like this:

B/S QUAN PRICE TYPE
S 3 -12.5 SEP06MAR07
S 3 -12.5 SEP06MAR07
S 2 -7.5 DEC06MAR07
S 2 -7.5 DEC06MAR07
S 3 -7.5 DEC06MAR07
S 7 -7.5 DEC06MAR07
S 3 -7.5 DEC06MAR07
S 2 0.5 DEC07MAR08
S 3 0.5 DEC07MAR08
S 2 0.5 DEC07MAR08
S 2 -5 SEP06DEC06
S 2 -7.5 DEC06MAR07
B 10 -13 SEP06MAR07
B 7 0.5 SEP07MAR08
S 14 -12.5 SEP06MAR07

What I would like to do is add the cell value in column QUAN whenever the
conditions are met in the corresponding row all the way down the column. So,
for the particular example, I would hope to have the cell that the formula is
in to return the value 20 based on the required conditions.



"ph8" wrote:


I'm not sure I fully understood what you needed. More particularly I am
unsure of what you wanted actually summed. This formula below will
perform the 'sum' operation when B2=S, D2=SEP06MAR07, and C2=-12.5.
You will want to edit the actual SUM function though, because like I
said, I am not sure what you wanted added together.

=if(B2="S",if(D2="SEP06MAR07",if(C2=-12.5,sum(B2:C3),""),""),"")

Is that anything close to what you wanted done?


--
ph8
------------------------------------------------------------------------
ph8's Profile: http://www.excelforum.com/member.php...o&userid=19871
View this thread: http://www.excelforum.com/showthread...hreadid=525124