Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,069
Default Sumproduct or ?????

Hi All,

I have 2 tables one is cust table and the other one is amount table.

A B C D
Customer Table Amount Table
Parent ID Cust # Cust # Amount
2001 AA AA 5
2001 BB AA 5
2001 CC AA 5
2001 DD AA 5
2001 EE AA -5
2001 FF AA -5
2001 GG BB 3
BB 3
BB -3

Summary

AA - I want to be able to count if "AA" in Cust table (Column B) then count
positive amount minus negative amount in amount table (Column D). 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: 1,240
Default Sumproduct or ?????

John wrote:
Hi All,

I have 2 tables one is cust table and the other one is amount table.

A B C D
Customer Table Amount Table
Parent ID Cust # Cust # Amount
2001 AA AA 5
2001 BB AA 5
2001 CC AA 5
2001 DD AA 5
2001 EE AA -5
2001 FF AA -5
2001 GG BB 3
BB 3
BB -3

Summary

AA - I want to be able to count if "AA" in Cust table (Column B) then count
positive amount minus negative amount in amount table (Column D). In this
case the answer is "2"

BB - The same thing with "BB". The answer is "1"
Thank you
John


With AA in C2 and your Amount Table in A1:B10 (headers in row 1):

=SUMPRODUCT(($A$2:$A$10=C2)*SIGN($B$2:$B$10))
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Sumproduct or ?????

Didn't Jacob and I already answer a similar question?

In E2:
=SUMPRODUCT((C$2:C$20=B2)*(SIGN(D$2:D$20)))

Copy down as desired.
--
Best Regards,

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


"John" wrote:

Hi All,

I have 2 tables one is cust table and the other one is amount table.

A B C D
Customer Table Amount Table
Parent ID Cust # Cust # Amount
2001 AA AA 5
2001 BB AA 5
2001 CC AA 5
2001 DD AA 5
2001 EE AA -5
2001 FF AA -5
2001 GG BB 3
BB 3
BB -3

Summary

AA - I want to be able to count if "AA" in Cust table (Column B) then count
positive amount minus negative amount in amount table (Column D). 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: 1,240
Default Sumproduct or ?????

Glenn wrote:
John wrote:
Hi All,

I have 2 tables one is cust table and the other one is amount table.

A B C D
Customer Table Amount Table
Parent ID Cust # Cust # Amount
2001 AA AA 5
2001 BB AA 5
2001 CC AA 5
2001 DD AA 5
2001 EE AA -5
2001 FF AA -5
2001 GG BB 3
BB 3
BB -3

Summary

AA - I want to be able to count if "AA" in Cust table (Column B) then
count positive amount minus negative amount in amount table (Column
D). In this case the answer is "2"

BB - The same thing with "BB". The answer is "1"
Thank you
John


With AA in C2 and your Amount Table in A1:B10 (headers in row 1):

=SUMPRODUCT(($A$2:$A$10=C2)*SIGN($B$2:$B$10))



Missed your column headings:

=SUMPRODUCT(($C$2:$C$10=B2)*SIGN($D$2:$D$10))
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,069
Default Sumproduct or ?????

Hi Luke,

You guys did but this one is a little different. I want to be able to write
like this:
=SUMPRODUCT(($C$2:$C$20=$B$2:$B$20)*(SIGN(D$2:D$20 )))

this one does not work because I change "B2" to "B2:B20".

"Luke M" wrote:

Didn't Jacob and I already answer a similar question?

In E2:
=SUMPRODUCT((C$2:C$20=B2)*(SIGN(D$2:D$20)))

Copy down as desired.
--
Best Regards,

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


"John" wrote:

Hi All,

I have 2 tables one is cust table and the other one is amount table.

A B C D
Customer Table Amount Table
Parent ID Cust # Cust # Amount
2001 AA AA 5
2001 BB AA 5
2001 CC AA 5
2001 DD AA 5
2001 EE AA -5
2001 FF AA -5
2001 GG BB 3
BB 3
BB -3

Summary

AA - I want to be able to count if "AA" in Cust table (Column B) then count
positive amount minus negative amount in amount table (Column D). In this
case the answer is "2"

BB - The same thing with "BB". The answer is "1"
Thank you
John



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Sumproduct or ?????

That formula works fine. It does exactly what you asked it to do.
For any row where the content of column B equals the content of column C in
the same row, the sign of the content of row D is added to the total.
If that wasn't what you wanted to do, you needed a different formula.

You asked a different question originally, and Luke and Jacob answered that
question, but it isn't clear what you now want to do.
--
David Biddulph

"John" wrote in message
...
Hi Luke,

You guys did but this one is a little different. I want to be able to
write
like this:
=SUMPRODUCT(($C$2:$C$20=$B$2:$B$20)*(SIGN(D$2:D$20 )))

this one does not work because I change "B2" to "B2:B20".

"Luke M" wrote:

Didn't Jacob and I already answer a similar question?

In E2:
=SUMPRODUCT((C$2:C$20=B2)*(SIGN(D$2:D$20)))

Copy down as desired.
--
Best Regards,

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


"John" wrote:

Hi All,

I have 2 tables one is cust table and the other one is amount table.

A B C D
Customer Table Amount Table
Parent ID Cust # Cust # Amount
2001 AA AA 5
2001 BB AA 5
2001 CC AA 5
2001 DD AA 5
2001 EE AA -5
2001 FF AA -5
2001 GG BB 3
BB 3
BB -3

Summary

AA - I want to be able to count if "AA" in Cust table (Column B) then
count
positive amount minus negative amount in amount table (Column D). 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
Sumproduct with Condition OR Sumproduct with ADDRESS function - HE gholly Excel Discussion (Misc queries) 2 September 28th 09 05:07 PM
Conditional SUMPRODUCT or SUMPRODUCT with Filters Ted M H Excel Worksheet Functions 4 August 14th 08 07:50 PM
sumproduct? sumif(sumproduct)? David Excel Worksheet Functions 3 July 13th 07 07:06 PM
Sumproduct ceemo Excel Worksheet Functions 3 February 28th 06 09:15 PM
sumproduct? JR Excel Worksheet Functions 1 February 4th 06 08:33 AM


All times are GMT +1. The time now is 05:40 PM.

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"