#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,069
Default Count formula

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



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Count formula

Try the below

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

If this post helps click Yes
---------------
Jacob Skaria


"John" wrote:

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



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Count formula

Here's the formula for AA

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

And for BB:

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

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


"John" wrote:

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



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,069
Default Count formula

Thank you, Luke. It works.

"Luke M" wrote:

Here's the formula for AA

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

And for BB:

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

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


"John" wrote:

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



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,069
Default Count formula

Thank you, Jacob.

"Jacob Skaria" wrote:

Try the below

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

If this post helps click Yes
---------------
Jacob Skaria


"John" wrote:

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count Formula - Count Ticks LittleAnn Excel Discussion (Misc queries) 3 May 8th 23 07:44 PM
Count Formula alish Excel Discussion (Misc queries) 5 June 10th 08 08:58 PM
Count Formula Brad Excel Worksheet Functions 1 August 9th 07 04:48 PM
Trying to construct a count count formula Chris K Excel Discussion (Misc queries) 6 May 26th 07 07:20 PM
Count formula help!! Beginner Excel Discussion (Misc queries) 7 December 28th 06 04:52 PM


All times are GMT +1. The time now is 02:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"