return a result from multiple conditions.

G

Guest

Is there one formula that will do the following?
A1:A3 = 7/9/2007 AND column C1:C3 =IN, then count (ADD) B1:B3
BUT if column C1:C3 = DD then subtract from the count of B1:B3
AND if colmun C1:C3 = OT then subtract from the count of B1:B3.

date count in/ot/dd
7/9/2007 10 IN
7/9/2007 1 DD
7/9/2007 8 OT

Example: +10 "IN" - 1 "DD" + 8 "OT" would = 1 on 6/27/07
Excel 2003, Thanks.
 
G

Guest

This should do the trick:

=SUMPRODUCT(--(A1:A3=DATE(2007,7,9)),IF(C1:C3="IN",B1:B3,IF(C1:C3="DD",-(B1:B3),IF(C1:C3="OT",-(B1:B3),0))))

Enter this as an array formula. Press CTRL-SHIFT-ENTER instead of just
Enter. If done properly, the formula should be enclosed in { }.

HTH,
Elkar
 
G

Guest

amung others
=sumproduct(--(A1:A3=date(2007,7,9)),--(C1:C3="IN)-(c1:C3="DD")-(C1:C3="OT"), B1:B3)

or

=sumif(C1:C3,"IN",B1:B3)-Sumif(C1:C3,"DD",B1:B3)-sumif(C1:C3,"OT",B1:B3)
 
G

Guest

I've entered this, double checked my entry 2x but it says I have a formula
problem. Any suggestions?
 
G

Guest

I double checked, and there aren't any errors in the formula I posted, you
must have missed something somewhere. But, give one of BJ's solutions a try.
Aside from a missing quotation mark in the first one, they should both work
as well.

HTH,
Elkar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top