Excel =SUMIF() problem/alternative

grantx

Senior member
Messages
2,331
Likes
223
Please refer to the attachment.

I'm trying to extract values from column B whose time (column A) corresponds to column C.

The formula =SUMIF(a$3:a$20000,d3,SUMIF(b$3:b$20000,">0"")) returns the error in formula message.

In isolation, =SUMIF(b$3:b$20000,">0") (or "<0")returns the correct figure.

=SUMIF(a$3:a$20000,d3,b$3:b$20000) returns a correct figure if all the values in column B are either positive or negative, but not both.

Where's the problem/what's the solution?

Thank you.

Grant.
 

Attachments

  • x.zip
    7.1 KB · Views: 159
Problem solved:

=SUMPRODUCT((A$3:A$20000=d3)*(B$3:B$20000>0)*B$3:B$20000) (and <0 for sales).

Grant.
 
Top