making a sum outcome negative based on adjacent cell value

J

judoist

I have 3 columns of single figures. At present i'm using the sumproduc
fuction to multiply and total the figures in column A that fall betwee
4 and 9 with the adjacent figure in column B...

=SUMPRODUCT(--($A1:$A600>=4),--($A1:$A600<=9),($B1:$B600),($A1:$A600)

I'd like to add column C to the formula, so that if it contained
value of -1, 1 or 2, the sum of the adjacent figures in columns A and
appears as a negative number.

For example

A3= 7, B3= 2, C3= 1 Outcome= -14

A4= 9, B4= 1, C4= 5 Outcome= 9

A5= 3, B5= 2, C5= 2 No sum because figure in column A doe
not fall between 4 and 9.

Can anyone help
 
D

Don Guillett

Try the same method you used below or

=SUMPRODUCT(--($A1:$A600>=4),--($A1:$A600<=9),($B1:$B600),($c1:$c600={-1,1,2
}),($A1:$A600)
 
R

RagDyer

I know there's a better way.
I just can't think of it right now.

=SUMPRODUCT(($A1:$A600>=4)*($A1:$A600<=9)*($B1:$B600)*($A1:$A600))-(SUMPRODU
CT(($A1:$A600>=4)*($A1:$A600<=9)*(C1:C600={-1,1,2})*($B1:$B600)*($A1:$A600))
)*2
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


Are you sure? Tried that and keep getting #VALUE!
 

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