Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default Sum data for weeks in a month

I need to add all values from each week into one sum per month.

For instance, below is some of my data as it's set up for my pivot table.

A B C
1 Week DEPTID Week hrs
2 27-Dec 1000 8.00
3 3-Jan 8100 16.00
4 10-Jan 7000 1.60
5 17-Jan 7000 4.40
6 24-Jan 8100 20.00

On a separate (non pivot table) sheet, how do I show a sum by month, like
this:

A B
1 Dec Jan
2 8.00 42.00

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Sum data for weeks in a month

Try this for Jan: =SUMPRODUCT(--(MONTH(A2:A6)=1),C2:C6) and for Feb:
=SUMPRODUCT(--(MONTH(A2:A6)=2),C2:C6).
You could change the numbers 1 and 2 in to formulas, by this dependens how
you're entering the values.
One possibility is =SUMPRODUCT(--(MONTH(A2:A6)=IF(A$1="Jan",1,2),C2:C6)


--
Adilson Soledade


"Eloise" wrote:

I need to add all values from each week into one sum per month.

For instance, below is some of my data as it's set up for my pivot table.

A B C
1 Week DEPTID Week hrs
2 27-Dec 1000 8.00
3 3-Jan 8100 16.00
4 10-Jan 7000 1.60
5 17-Jan 7000 4.40
6 24-Jan 8100 20.00

On a separate (non pivot table) sheet, how do I show a sum by month, like
this:

A B
1 Dec Jan
2 8.00 42.00

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default Sum data for weeks in a month

What does the "--" after SUMPRODUCT represent? I think I'm doing something
wrong because it's not working. My hours data is on a sheet called "Labor
Actuals" and the monthly sum is on a sheet called "Summary" within the same
document. Does this change things?

My formatting is like it's listed below (d-mmm), so still not quite getting
how to set the formula (and why sumproduct? I don't want to multiply, just
add each week)

Thanks

"Adilson Soledade" wrote:

Try this for Jan: =SUMPRODUCT(--(MONTH(A2:A6)=1),C2:C6) and for Feb:
=SUMPRODUCT(--(MONTH(A2:A6)=2),C2:C6).
You could change the numbers 1 and 2 in to formulas, by this dependens how
you're entering the values.
One possibility is =SUMPRODUCT(--(MONTH(A2:A6)=IF(A$1="Jan",1,2),C2:C6)


--
Adilson Soledade


"Eloise" wrote:

I need to add all values from each week into one sum per month.

For instance, below is some of my data as it's set up for my pivot table.

A B C
1 Week DEPTID Week hrs
2 27-Dec 1000 8.00
3 3-Jan 8100 16.00
4 10-Jan 7000 1.60
5 17-Jan 7000 4.40
6 24-Jan 8100 20.00

On a separate (non pivot table) sheet, how do I show a sum by month, like
this:

A B
1 Dec Jan
2 8.00 42.00

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Sum data for weeks in a month

Let's go step by step:
The SUMPRODUCT function must work with numeric values. When we use the
function MONTH(A1:A6)=1, the result is an array with TRUE and FALSE values.
So we use the double minus signal "--" or function N or multiply by 1 to
transform these in numeric values. TRUE become 1 and FALSE become 0.
You must specify the origin of each range you use in the formulas. In your
case, the function =SUMPRODUCT(--(MONTH(A2:A6)=1),C2:C6) became, somethig like
=SUMPRODUCT(--(MONTH(Summary!A2:A6)=1),'Labor Actuals'!C2:C6) .
The SUMPRODUCT function will first values 1 or 0 in the first argument, with
the respective hour values in the second argument. If the month is the
desired month in the first column the value is 1 and this multiplied by the
number of hours in hte second column. If the month is not the desired the
first column result is zero and so is the match product. So you add only the
value wich satisfied the condition we stablished before.
I hope I was clear. Any doubts, please be comfort to argue.
--
Adilson Soledade


"Eloise" wrote:

What does the "--" after SUMPRODUCT represent? I think I'm doing something
wrong because it's not working. My hours data is on a sheet called "Labor
Actuals" and the monthly sum is on a sheet called "Summary" within the same
document. Does this change things?

My formatting is like it's listed below (d-mmm), so still not quite getting
how to set the formula (and why sumproduct? I don't want to multiply, just
add each week)

Thanks

"Adilson Soledade" wrote:

Try this for Jan: =SUMPRODUCT(--(MONTH(A2:A6)=1),C2:C6) and for Feb:
=SUMPRODUCT(--(MONTH(A2:A6)=2),C2:C6).
You could change the numbers 1 and 2 in to formulas, by this dependens how
you're entering the values.
One possibility is =SUMPRODUCT(--(MONTH(A2:A6)=IF(A$1="Jan",1,2),C2:C6)


--
Adilson Soledade


"Eloise" wrote:

I need to add all values from each week into one sum per month.

For instance, below is some of my data as it's set up for my pivot table.

A B C
1 Week DEPTID Week hrs
2 27-Dec 1000 8.00
3 3-Jan 8100 16.00
4 10-Jan 7000 1.60
5 17-Jan 7000 4.40
6 24-Jan 8100 20.00

On a separate (non pivot table) sheet, how do I show a sum by month, like
this:

A B
1 Dec Jan
2 8.00 42.00

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default Sum data for weeks in a month

OK, that makes sense now and I got it to work. Thanks for walking me through
the pieces.


"Adilson Soledade" wrote:

Let's go step by step:
The SUMPRODUCT function must work with numeric values. When we use the
function MONTH(A1:A6)=1, the result is an array with TRUE and FALSE values.
So we use the double minus signal "--" or function N or multiply by 1 to
transform these in numeric values. TRUE become 1 and FALSE become 0.
You must specify the origin of each range you use in the formulas. In your
case, the function =SUMPRODUCT(--(MONTH(A2:A6)=1),C2:C6) became, somethig like
=SUMPRODUCT(--(MONTH(Summary!A2:A6)=1),'Labor Actuals'!C2:C6) .
The SUMPRODUCT function will first values 1 or 0 in the first argument, with
the respective hour values in the second argument. If the month is the
desired month in the first column the value is 1 and this multiplied by the
number of hours in hte second column. If the month is not the desired the
first column result is zero and so is the match product. So you add only the
value wich satisfied the condition we stablished before.
I hope I was clear. Any doubts, please be comfort to argue.
--
Adilson Soledade


"Eloise" wrote:

What does the "--" after SUMPRODUCT represent? I think I'm doing something
wrong because it's not working. My hours data is on a sheet called "Labor
Actuals" and the monthly sum is on a sheet called "Summary" within the same
document. Does this change things?

My formatting is like it's listed below (d-mmm), so still not quite getting
how to set the formula (and why sumproduct? I don't want to multiply, just
add each week)

Thanks

"Adilson Soledade" wrote:

Try this for Jan: =SUMPRODUCT(--(MONTH(A2:A6)=1),C2:C6) and for Feb:
=SUMPRODUCT(--(MONTH(A2:A6)=2),C2:C6).
You could change the numbers 1 and 2 in to formulas, by this dependens how
you're entering the values.
One possibility is =SUMPRODUCT(--(MONTH(A2:A6)=IF(A$1="Jan",1,2),C2:C6)


--
Adilson Soledade


"Eloise" wrote:

I need to add all values from each week into one sum per month.

For instance, below is some of my data as it's set up for my pivot table.

A B C
1 Week DEPTID Week hrs
2 27-Dec 1000 8.00
3 3-Jan 8100 16.00
4 10-Jan 7000 1.60
5 17-Jan 7000 4.40
6 24-Jan 8100 20.00

On a separate (non pivot table) sheet, how do I show a sum by month, like
this:

A B
1 Dec Jan
2 8.00 42.00

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
How do you calculate the number of weeks on a month Sunnyskies Excel Discussion (Misc queries) 7 April 4th 23 11:23 AM
Excel 2003 month to month data change grid Chad[_2_] Excel Discussion (Misc queries) 2 February 15th 08 01:36 AM
How do I count the number of even weeks in the current month. dd Excel Worksheet Functions 6 February 22nd 07 07:29 AM
Archiving 4 weeks of data into Month folders mosh Excel Discussion (Misc queries) 1 June 19th 06 12:32 AM
calculate weeks from a start date ( not yr weeks) Todd F. Excel Worksheet Functions 6 November 27th 04 05:53 PM


All times are GMT +1. The time now is 06:09 AM.

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"