Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Todd
 
Posts: n/a
Default sum based on multiple criteria

how do I sum a column of data based on criteria in two other columns? I have
three columns of data, one contains account numbers, one dates and the third
data to be summed. The difficulty is that there are duplicate entries and
the account numbers go to 8 digits and I am summing to 6.

customer-project-part Hours Date
A B
C
1234-02-06 20
01/01/06
1234-02-07 20
01/01/06
1234-02-08 20
02/02/06

sum of 1234-02 =40

The account 1234-02-07 is ignored because it is on the same date as
1234-02-06. The situation is that I am adding the total number of hours a
machine is run but there are multiple parts going through at once. So I am
adding only one occurance per project number for each day.


Thanks

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default sum based on multiple criteria

One way

=SUMPRODUCT(--(C2:C10=--"2006-1-1"),--(LEFT(TRIM(A2:A10),7)="1234-02"),B2:B10)



--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com



"Todd" wrote in message
...
how do I sum a column of data based on criteria in two other columns? I
have
three columns of data, one contains account numbers, one dates and the
third
data to be summed. The difficulty is that there are duplicate entries and
the account numbers go to 8 digits and I am summing to 6.

customer-project-part Hours Date
A B
C
1234-02-06 20
01/01/06
1234-02-07 20
01/01/06
1234-02-08 20
02/02/06

sum of 1234-02 =40

The account 1234-02-07 is ignored because it is on the same date as
1234-02-06. The situation is that I am adding the total number of hours
a
machine is run but there are multiple parts going through at once. So I
am
adding only one occurance per project number for each day.


Thanks



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Todd
 
Posts: n/a
Default sum based on multiple criteria

Thats working, thank you. Why is the date double negated?

"Peo Sjoblom" wrote:

One way

=SUMPRODUCT(--(C2:C10=--"2006-1-1"),--(LEFT(TRIM(A2:A10),7)="1234-02"),B2:B10)



--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com



"Todd" wrote in message
...
how do I sum a column of data based on criteria in two other columns? I
have
three columns of data, one contains account numbers, one dates and the
third
data to be summed. The difficulty is that there are duplicate entries and
the account numbers go to 8 digits and I am summing to 6.

customer-project-part Hours Date
A B
C
1234-02-06 20
01/01/06
1234-02-07 20
01/01/06
1234-02-08 20
02/02/06

sum of 1234-02 =40

The account 1234-02-07 is ignored because it is on the same date as
1234-02-06. The situation is that I am adding the total number of hours
a
machine is run but there are multiple parts going through at once. So I
am
adding only one occurance per project number for each day.


Thanks




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default sum based on multiple criteria

It's because excel dates are numbers and to trick excel into converting a
date string into a number date it has to be put there as text and then
converted, you can use 0+ or 1* instead but I have gotten used to this
You can replace that part with a cell like H2 and just put the date in H2
instead


--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com


"Todd" wrote in message
...
Thats working, thank you. Why is the date double negated?

"Peo Sjoblom" wrote:

One way

=SUMPRODUCT(--(C2:C10=--"2006-1-1"),--(LEFT(TRIM(A2:A10),7)="1234-02"),B2:B10)



--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com



"Todd" wrote in message
...
how do I sum a column of data based on criteria in two other columns?
I
have
three columns of data, one contains account numbers, one dates and the
third
data to be summed. The difficulty is that there are duplicate entries
and
the account numbers go to 8 digits and I am summing to 6.

customer-project-part Hours Date
A B
C
1234-02-06 20
01/01/06
1234-02-07 20
01/01/06
1234-02-08 20
02/02/06

sum of 1234-02 =40

The account 1234-02-07 is ignored because it is on the same date as
1234-02-06. The situation is that I am adding the total number of
hours
a
machine is run but there are multiple parts going through at once. So
I
am
adding only one occurance per project number for each day.


Thanks






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
Calculating an average based on 2 and 3 criteria craggergirl Excel Worksheet Functions 2 February 24th 06 02:37 PM
Returning Results Based on Two Criteria [email protected] Excel Worksheet Functions 7 October 23rd 05 02:53 PM
Counting by multiple criteria Risky Dave Excel Worksheet Functions 4 September 28th 05 01:29 PM
Using Sumproduct with multiple Criteria Mark Jackson Excel Worksheet Functions 1 May 6th 05 10:07 PM
Count rows based on multiple criteria Murph Excel Worksheet Functions 1 October 28th 04 07:13 AM


All times are GMT +1. The time now is 11:37 PM.

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

About Us

"It's about Microsoft Excel"