Count formula

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi All,

I have a problem below. Could somebody help, please. Thanks in advance.

Cust Amount
AA 5
AA 5
AA 5
AA 5
AA -5
AA -5
BB 7
BB 7
BB -7


AA - I want to be able to count if "AA" in range A2:A10 then count positive
amount minus negative amount in B2:B10. In this case, the answer is "2"

BB - The same thing with "BB". The answer is "1"

Thank you
John
 
Try the below

=SUMPRODUCT((A2:A10="AA")*(SIGN(B2:B10)))

If this post helps click Yes
 
Here's the formula for AA

=SUMPRODUCT((A2:A10="AA")*((B2:B10>0)-(B2:B10<0)))

And for BB:

=SUMPRODUCT((A2:A10="BB")*((B2:B10>0)-(B2:B10<0)))
 
Thank you, Luke. It works.

Luke M said:
Here's the formula for AA

=SUMPRODUCT((A2:A10="AA")*((B2:B10>0)-(B2:B10<0)))

And for BB:

=SUMPRODUCT((A2:A10="BB")*((B2:B10>0)-(B2:B10<0)))
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*
 

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

Similar Threads

Sumproduct or ????? 4
SUMPRODUCT 5
Filter formula 8
"Conditional" sum 3
More conditions 3
multiple dependent drop down lists 6
incremental counting based on criteria 4
Counting between dates 2

Back
Top