A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Sum of named ranges conditional to date?



 
 
Thread Tools Display Modes
  #11  
Old February 19th, 2009, 09:22 PM posted to microsoft.public.excel.worksheet.functions
Gus
external usenet poster
 
Posts: 69
Default Sum of named ranges conditional to date?

Hi,

I have a similar situation, but with data in rows.
Here is the formula which does not work for me (why?) but when I change
today's date to a number it works.

=SUMIF($AA$3:$CU$3,$X$1,$AA4:$CU4)

top row AA3 - CU3 contains months.
below row AA4 - CU4 contains values
my objective is to sum all of the values for past months ( in comparison to
current month, which is located in the cell X1)

Thanks, Gus




"SleazyBreezy" wrote:

Hi all,

Say I have a spreadsheet listed as follows:

A1 = 03/31/05
A2 = $5.00

B1 = 03/31/05
B2 = $10.00

C1 = 04/01/05
C2 = $20.00

The entire A column is named "Base_Date" and the entire B column is named
"Base_Amount".

I would like a formula that will sum values in the Amount column that
correspond with a specific date range, ie. March only. This formula must
reside in a different worksheet (within the same workbook).

I've tried the following:

=SUM(IF(Base_Date=DATEVALUE("03/01/2005"),IF(Base_Date=DATEVALUE("03/31/2005"),Base_Amount,0),0))

If I place the formula in a seperate worksheet from the data (as intended),
its value is $35.00 (adds all values in column B) when I'm expecting it to be
only $15.00.

If I place the formula in the same worksheet as the data (not in columns A
or B), its value is reported as 0.

I'm sure I'm missing something miniscule here. Any suggestions?

TIA,
Sleazy

  #12  
Old February 19th, 2009, 09:45 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Sum of named ranges conditional to date?

top row AA3 - CU3 contains months.

In what form? Are they the month names as *TEXT* entrires: Jan, Feb, Mar?

Are they *DATES* formatted to display the month name?

when I change today's date to a number it works.


How are you changing today's date to a number? What number?

Maybe you want something like this:

=SUMPRODUCT(--(MONTH($AA$3:$CU$3)MONTH($X$1)),$AA4:$CU4)


--
Biff
Microsoft Excel MVP


"Gus" wrote in message
...
Hi,

I have a similar situation, but with data in rows.
Here is the formula which does not work for me (why?) but when I change
today's date to a number it works.

=SUMIF($AA$3:$CU$3,$X$1,$AA4:$CU4)

top row AA3 - CU3 contains months.
below row AA4 - CU4 contains values
my objective is to sum all of the values for past months ( in comparison
to
current month, which is located in the cell X1)

Thanks, Gus




"SleazyBreezy" wrote:

Hi all,

Say I have a spreadsheet listed as follows:

A1 = 03/31/05
A2 = $5.00

B1 = 03/31/05
B2 = $10.00

C1 = 04/01/05
C2 = $20.00

The entire A column is named "Base_Date" and the entire B column is named
"Base_Amount".

I would like a formula that will sum values in the Amount column that
correspond with a specific date range, ie. March only. This formula must
reside in a different worksheet (within the same workbook).

I've tried the following:

=SUM(IF(Base_Date=DATEVALUE("03/01/2005"),IF(Base_Date=DATEVALUE("03/31/2005"),Base_Amount,0),0))

If I place the formula in a seperate worksheet from the data (as
intended),
its value is $35.00 (adds all values in column B) when I'm expecting it
to be
only $15.00.

If I place the formula in the same worksheet as the data (not in columns
A
or B), its value is reported as 0.

I'm sure I'm missing something miniscule here. Any suggestions?

TIA,
Sleazy



  #13  
Old February 19th, 2009, 09:59 PM posted to microsoft.public.excel.worksheet.functions
Gus
external usenet poster
 
Posts: 69
Default Sum of named ranges conditional to date?

The top raw is in the date format ( 1/1/2008 to display Jan-08).
If the date in cell X1 is formated same way as above, the formula does not
work, why?.
Once I change it to =39814 then the formula works.

Gus





"T. Valko" wrote:

top row AA3 - CU3 contains months.


In what form? Are they the month names as *TEXT* entrires: Jan, Feb, Mar?

Are they *DATES* formatted to display the month name?

when I change today's date to a number it works.


How are you changing today's date to a number? What number?

Maybe you want something like this:

=SUMPRODUCT(--(MONTH($AA$3:$CU$3)MONTH($X$1)),$AA4:$CU4)


--
Biff
Microsoft Excel MVP


"Gus" wrote in message
...
Hi,

I have a similar situation, but with data in rows.
Here is the formula which does not work for me (why?) but when I change
today's date to a number it works.

=SUMIF($AA$3:$CU$3,$X$1,$AA4:$CU4)

top row AA3 - CU3 contains months.
below row AA4 - CU4 contains values
my objective is to sum all of the values for past months ( in comparison
to
current month, which is located in the cell X1)

Thanks, Gus




"SleazyBreezy" wrote:

Hi all,

Say I have a spreadsheet listed as follows:

A1 = 03/31/05
A2 = $5.00

B1 = 03/31/05
B2 = $10.00

C1 = 04/01/05
C2 = $20.00

The entire A column is named "Base_Date" and the entire B column is named
"Base_Amount".

I would like a formula that will sum values in the Amount column that
correspond with a specific date range, ie. March only. This formula must
reside in a different worksheet (within the same workbook).

I've tried the following:

=SUM(IF(Base_Date=DATEVALUE("03/01/2005"),IF(Base_Date=DATEVALUE("03/31/2005"),Base_Amount,0),0))

If I place the formula in a seperate worksheet from the data (as
intended),
its value is $35.00 (adds all values in column B) when I'm expecting it
to be
only $15.00.

If I place the formula in the same worksheet as the data (not in columns
A
or B), its value is reported as 0.

I'm sure I'm missing something miniscule here. Any suggestions?

TIA,
Sleazy




  #14  
Old February 19th, 2009, 10:10 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Sum of named ranges conditional to date?

If the date in cell X1 is formated same way as above,
the formula does not work, why?.


It should. Try it like this:

=SUMIF($AA$3:$CU$3,"="&$X$1,$AA4:$CU4)

--
Biff
Microsoft Excel MVP


"Gus" wrote in message
...
The top raw is in the date format ( 1/1/2008 to display Jan-08).
If the date in cell X1 is formated same way as above, the formula does not
work, why?.
Once I change it to =39814 then the formula works.

Gus





"T. Valko" wrote:

top row AA3 - CU3 contains months.


In what form? Are they the month names as *TEXT* entrires: Jan, Feb, Mar?

Are they *DATES* formatted to display the month name?

when I change today's date to a number it works.


How are you changing today's date to a number? What number?

Maybe you want something like this:

=SUMPRODUCT(--(MONTH($AA$3:$CU$3)MONTH($X$1)),$AA4:$CU4)


--
Biff
Microsoft Excel MVP


"Gus" wrote in message
...
Hi,

I have a similar situation, but with data in rows.
Here is the formula which does not work for me (why?) but when I change
today's date to a number it works.

=SUMIF($AA$3:$CU$3,$X$1,$AA4:$CU4)

top row AA3 - CU3 contains months.
below row AA4 - CU4 contains values
my objective is to sum all of the values for past months ( in
comparison
to
current month, which is located in the cell X1)

Thanks, Gus




"SleazyBreezy" wrote:

Hi all,

Say I have a spreadsheet listed as follows:

A1 = 03/31/05
A2 = $5.00

B1 = 03/31/05
B2 = $10.00

C1 = 04/01/05
C2 = $20.00

The entire A column is named "Base_Date" and the entire B column is
named
"Base_Amount".

I would like a formula that will sum values in the Amount column that
correspond with a specific date range, ie. March only. This formula
must
reside in a different worksheet (within the same workbook).

I've tried the following:

=SUM(IF(Base_Date=DATEVALUE("03/01/2005"),IF(Base_Date=DATEVALUE("03/31/2005"),Base_Amount,0),0))

If I place the formula in a seperate worksheet from the data (as
intended),
its value is $35.00 (adds all values in column B) when I'm expecting
it
to be
only $15.00.

If I place the formula in the same worksheet as the data (not in
columns
A
or B), its value is reported as 0.

I'm sure I'm missing something miniscule here. Any suggestions?

TIA,
Sleazy






  #15  
Old March 20th, 2009, 09:51 AM posted to microsoft.public.excel.worksheet.functions
tywlam
external usenet poster
 
Posts: 22
Default Sum of named ranges conditional to date?

The SUMIF function can work with one criteria given. How can I modify a
formula by adding other functions to make the SUMIF work with TWO criterion
met?

Thanks



"SleazyBreezy" wrote:

Thank you very much! Thankfully, my date criteria is static, so the X2/Y2
variables are not needed. I used your formula to achieve the desired result
by moving the closing quotes as follows:

=SUMIF(Base_Date,"=03/01/2005",Base_Amount)-SUMIF(Base_Date,"03/31/2005",Base_Amount)


"Aladin Akyurek" wrote:

=SUMIF(Base_Date,"="&X2,Base_Amount)-SUMIF(Base_Date,""&Y2,Base_Amount)

where X2 houses the first day date of the month/year of interset like:
03/01/2005 and Y2 one of:

03/31/2005

=DATE(YEAR(X2),MONTH(X2)+1,0)

  #16  
Old March 20th, 2009, 11:26 AM posted to microsoft.public.excel.worksheet.functions
Roger Govier[_3_]
external usenet poster
 
Posts: 2,297
Default Sum of named ranges conditional to date?

Hi

Up until XL2003, Sumif takes a single Criterion.
With XL2007, SUMIFS allows multiple criteria.

If you are using 2003 or lower, consider the use of Sumproduct.

=SUMPRODUCT((Range1=X1)*(Range2=Y1)*(Range3=Z1)*Ra nge4)
Where Range 4 is the values to be Summed, the other Ranges are what you are
wanting to match against certain values held in cells X1, Y1 and Z1.
Ensure the Ranges are of equal size, and in 2003 and lower, ranges cannot be
whole columns.

--
Regards
Roger Govier

"tywlam" wrote in message
...
The SUMIF function can work with one criteria given. How can I modify a
formula by adding other functions to make the SUMIF work with TWO
criterion
met?

Thanks



"SleazyBreezy" wrote:

Thank you very much! Thankfully, my date criteria is static, so the X2/Y2
variables are not needed. I used your formula to achieve the desired
result
by moving the closing quotes as follows:

=SUMIF(Base_Date,"=03/01/2005",Base_Amount)-SUMIF(Base_Date,"03/31/2005",Base_Amount)


"Aladin Akyurek" wrote:

=SUMIF(Base_Date,"="&X2,Base_Amount)-SUMIF(Base_Date,""&Y2,Base_Amount)

where X2 houses the first day date of the month/year of interset like:
03/01/2005 and Y2 one of:

03/31/2005

=DATE(YEAR(X2),MONTH(X2)+1,0)

  #17  
Old March 23rd, 2009, 02:37 AM posted to microsoft.public.excel.worksheet.functions
tywlam
external usenet poster
 
Posts: 22
Default Sum of named ranges conditional to date?

Thanks Roger. But it just couldn't work! Let me take an example below:

Col.A Col.B Col.C
Row1 Project Date Amount
Row2 AAA 01/03/2008 200
Row3 BBB 01/03/2008 100
Row4 AAA 15/03/2008 20
Row5 CCC 02/03/3008 10
Row6 DDD 01/04/2008 200
Row7 CCC 27/03/2008 130
Row8 AAA 05/04/2008 30

I'd like to sum the values in Col.C with project name of AAA in Col.A and
date of March 2008 in Col.B. I write the the formula:
=SUMPRODUCT((A1:A8="AAA")*(B1:B8="**/03/****")*(C1:C8)) but it gives the
result of zero! The correct answer should be 220. (200+20)

Please help!

Regards,
Terry


"Roger Govier" wrote:

Hi

Up until XL2003, Sumif takes a single Criterion.
With XL2007, SUMIFS allows multiple criteria.

If you are using 2003 or lower, consider the use of Sumproduct.

=SUMPRODUCT((Range1=X1)*(Range2=Y1)*(Range3=Z1)*Ra nge4)
Where Range 4 is the values to be Summed, the other Ranges are what you are
wanting to match against certain values held in cells X1, Y1 and Z1.
Ensure the Ranges are of equal size, and in 2003 and lower, ranges cannot be
whole columns.

--
Regards
Roger Govier

"tywlam" wrote in message
...
The SUMIF function can work with one criteria given. How can I modify a
formula by adding other functions to make the SUMIF work with TWO
criterion
met?

Thanks



"SleazyBreezy" wrote:

Thank you very much! Thankfully, my date criteria is static, so the X2/Y2
variables are not needed. I used your formula to achieve the desired
result
by moving the closing quotes as follows:

=SUMIF(Base_Date,"=03/01/2005",Base_Amount)-SUMIF(Base_Date,"03/31/2005",Base_Amount)


"Aladin Akyurek" wrote:

=SUMIF(Base_Date,"="&X2,Base_Amount)-SUMIF(Base_Date,""&Y2,Base_Amount)

where X2 houses the first day date of the month/year of interset like:
03/01/2005 and Y2 one of:

03/31/2005

=DATE(YEAR(X2),MONTH(X2)+1,0)

  #18  
Old March 23rd, 2009, 11:10 AM posted to microsoft.public.excel.worksheet.functions
Roger Govier[_3_]
external usenet poster
 
Posts: 2,297
Default Sum of named ranges conditional to date?

Hi

It will work, if you need to change the formula slightly.
dates are stored as serial numbers, hence they will never be "seen" as **
/03/ ****.
You need to compare the Text(date,"mmyyyy") to get your result.

=SUMPRODUCT((A1:A8="AAA")*(TEXT(B1:B8,"mmyyyy")="0 32008")*C1:C8)

You don't need parentheses around the C values, as they are your data and
are not being used in any comparison.
Including them, will nit prevent the formula working - they are just not
necessary.

--
Regards
Roger Govier

"tywlam" wrote in message
...
Thanks Roger. But it just couldn't work! Let me take an example below:

Col.A Col.B Col.C
Row1 Project Date Amount
Row2 AAA 01/03/2008 200
Row3 BBB 01/03/2008 100
Row4 AAA 15/03/2008 20
Row5 CCC 02/03/3008 10
Row6 DDD 01/04/2008 200
Row7 CCC 27/03/2008 130
Row8 AAA 05/04/2008 30

I'd like to sum the values in Col.C with project name of AAA in Col.A and
date of March 2008 in Col.B. I write the the formula:
=SUMPRODUCT((A1:A8="AAA")*(B1:B8="**/03/****")*(C1:C8)) but it gives the
result of zero! The correct answer should be 220. (200+20)

Please help!

Regards,
Terry


"Roger Govier" wrote:

Hi

Up until XL2003, Sumif takes a single Criterion.
With XL2007, SUMIFS allows multiple criteria.

If you are using 2003 or lower, consider the use of Sumproduct.

=SUMPRODUCT((Range1=X1)*(Range2=Y1)*(Range3=Z1)*Ra nge4)
Where Range 4 is the values to be Summed, the other Ranges are what you
are
wanting to match against certain values held in cells X1, Y1 and Z1.
Ensure the Ranges are of equal size, and in 2003 and lower, ranges cannot
be
whole columns.

--
Regards
Roger Govier

"tywlam" wrote in message
...
The SUMIF function can work with one criteria given. How can I modify
a
formula by adding other functions to make the SUMIF work with TWO
criterion
met?

Thanks



"SleazyBreezy" wrote:

Thank you very much! Thankfully, my date criteria is static, so the
X2/Y2
variables are not needed. I used your formula to achieve the desired
result
by moving the closing quotes as follows:

=SUMIF(Base_Date,"=03/01/2005",Base_Amount)-SUMIF(Base_Date,"03/31/2005",Base_Amount)


"Aladin Akyurek" wrote:

=SUMIF(Base_Date,"="&X2,Base_Amount)-SUMIF(Base_Date,""&Y2,Base_Amount)

where X2 houses the first day date of the month/year of interset
like:
03/01/2005 and Y2 one of:

03/31/2005

=DATE(YEAR(X2),MONTH(X2)+1,0)

  #19  
Old March 24th, 2009, 02:52 AM posted to microsoft.public.excel.worksheet.functions
tywlam
external usenet poster
 
Posts: 22
Default Sum of named ranges conditional to date?

It works when both criteria and formula are in the same worksheet. Thank
you. But when the formula is not in the same worksheet, it give all zero
results!! I've checked the formula carefully and also used the functions bar
dialog box to set up my formula. It still doesn't work! Do you know why?

Regards,


"Roger Govier" wrote:

Hi

It will work, if you need to change the formula slightly.
dates are stored as serial numbers, hence they will never be "seen" as **
/03/ ****.
You need to compare the Text(date,"mmyyyy") to get your result.

=SUMPRODUCT((A1:A8="AAA")*(TEXT(B1:B8,"mmyyyy")="0 32008")*C1:C8)

You don't need parentheses around the C values, as they are your data and
are not being used in any comparison.
Including them, will nit prevent the formula working - they are just not
necessary.

--
Regards
Roger Govier

"tywlam" wrote in message
...
Thanks Roger. But it just couldn't work! Let me take an example below:

Col.A Col.B Col.C
Row1 Project Date Amount
Row2 AAA 01/03/2008 200
Row3 BBB 01/03/2008 100
Row4 AAA 15/03/2008 20
Row5 CCC 02/03/3008 10
Row6 DDD 01/04/2008 200
Row7 CCC 27/03/2008 130
Row8 AAA 05/04/2008 30

I'd like to sum the values in Col.C with project name of AAA in Col.A and
date of March 2008 in Col.B. I write the the formula:
=SUMPRODUCT((A1:A8="AAA")*(B1:B8="**/03/****")*(C1:C8)) but it gives the
result of zero! The correct answer should be 220. (200+20)

Please help!

Regards,
Terry


"Roger Govier" wrote:

Hi

Up until XL2003, Sumif takes a single Criterion.
With XL2007, SUMIFS allows multiple criteria.

If you are using 2003 or lower, consider the use of Sumproduct.

=SUMPRODUCT((Range1=X1)*(Range2=Y1)*(Range3=Z1)*Ra nge4)
Where Range 4 is the values to be Summed, the other Ranges are what you
are
wanting to match against certain values held in cells X1, Y1 and Z1.
Ensure the Ranges are of equal size, and in 2003 and lower, ranges cannot
be
whole columns.

--
Regards
Roger Govier

"tywlam" wrote in message
...
The SUMIF function can work with one criteria given. How can I modify
a
formula by adding other functions to make the SUMIF work with TWO
criterion
met?

Thanks



"SleazyBreezy" wrote:

Thank you very much! Thankfully, my date criteria is static, so the
X2/Y2
variables are not needed. I used your formula to achieve the desired
result
by moving the closing quotes as follows:

=SUMIF(Base_Date,"=03/01/2005",Base_Amount)-SUMIF(Base_Date,"03/31/2005",Base_Amount)


"Aladin Akyurek" wrote:

=SUMIF(Base_Date,"="&X2,Base_Amount)-SUMIF(Base_Date,""&Y2,Base_Amount)

where X2 houses the first day date of the month/year of interset
like:
03/01/2005 and Y2 one of:

03/31/2005

=DATE(YEAR(X2),MONTH(X2)+1,0)

  #20  
Old March 24th, 2009, 08:10 AM posted to microsoft.public.excel.worksheet.functions
tywlam
external usenet poster
 
Posts: 22
Default Sum of named ranges conditional to date?

Another problem: If I put a Cell number that is reference to a text in
another cell in substitute of direct text "AAA" in the formula, the result
becomes zero again! How do I format the cell or change the formula?

Regards,
Terry


"Roger Govier" wrote:

Hi

It will work, if you need to change the formula slightly.
dates are stored as serial numbers, hence they will never be "seen" as **
/03/ ****.
You need to compare the Text(date,"mmyyyy") to get your result.

=SUMPRODUCT((A1:A8="AAA")*(TEXT(B1:B8,"mmyyyy")="0 32008")*C1:C8)

You don't need parentheses around the C values, as they are your data and
are not being used in any comparison.
Including them, will nit prevent the formula working - they are just not
necessary.

--
Regards
Roger Govier

"tywlam" wrote in message
...
Thanks Roger. But it just couldn't work! Let me take an example below:

Col.A Col.B Col.C
Row1 Project Date Amount
Row2 AAA 01/03/2008 200
Row3 BBB 01/03/2008 100
Row4 AAA 15/03/2008 20
Row5 CCC 02/03/3008 10
Row6 DDD 01/04/2008 200
Row7 CCC 27/03/2008 130
Row8 AAA 05/04/2008 30

I'd like to sum the values in Col.C with project name of AAA in Col.A and
date of March 2008 in Col.B. I write the the formula:
=SUMPRODUCT((A1:A8="AAA")*(B1:B8="**/03/****")*(C1:C8)) but it gives the
result of zero! The correct answer should be 220. (200+20)

Please help!

Regards,
Terry


"Roger Govier" wrote:

Hi

Up until XL2003, Sumif takes a single Criterion.
With XL2007, SUMIFS allows multiple criteria.

If you are using 2003 or lower, consider the use of Sumproduct.

=SUMPRODUCT((Range1=X1)*(Range2=Y1)*(Range3=Z1)*Ra nge4)
Where Range 4 is the values to be Summed, the other Ranges are what you
are
wanting to match against certain values held in cells X1, Y1 and Z1.
Ensure the Ranges are of equal size, and in 2003 and lower, ranges cannot
be
whole columns.

--
Regards
Roger Govier

"tywlam" wrote in message
...
The SUMIF function can work with one criteria given. How can I modify
a
formula by adding other functions to make the SUMIF work with TWO
criterion
met?

Thanks



"SleazyBreezy" wrote:

Thank you very much! Thankfully, my date criteria is static, so the
X2/Y2
variables are not needed. I used your formula to achieve the desired
result
by moving the closing quotes as follows:

=SUMIF(Base_Date,"=03/01/2005",Base_Amount)-SUMIF(Base_Date,"03/31/2005",Base_Amount)


"Aladin Akyurek" wrote:

=SUMIF(Base_Date,"="&X2,Base_Amount)-SUMIF(Base_Date,""&Y2,Base_Amount)

where X2 houses the first day date of the month/year of interset
like:
03/01/2005 and Y2 one of:

03/31/2005

=DATE(YEAR(X2),MONTH(X2)+1,0)

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Like 123, allow named ranges, and print named ranges WP General Discussion 1 April 8th, 2005 06:07 PM
Aggregating Date Data into Weeks and Quarters Roger Running & Setting Up Queries 3 July 11th, 2004 05:56 PM
How Do You Call Several Named Ranges From A Named Range Minitman Worksheet Functions 14 March 24th, 2004 11:18 PM
Copying Worksheets with Named Ranges Anthony Cravero Worksheet Functions 3 December 19th, 2003 06:05 PM
Counting cells with specific date ranges Dino Worksheet Functions 1 October 9th, 2003 08:00 PM


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


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