Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default SUMPRODUCT, INDIRECT, dates...

Hi,

I recently asked for help looking up values in one column by the year in
another column on different worksheets, and was very kindly given the
following solution:

=SUMPRODUCT(--(YEAR(INDIRECT("'"&A3&"'!H8:H1000"))=2008),INDIREC T("'"&A3&"'!I8:I1000"))

I have now been asked to add sub-totals by month! I came up with:

=SUMPRODUCT(AND(--(YEAR(INDIRECT("'"&A3&"'!H8:H1000"))=2008),(--(MONTH(INDIRECT("'"&A3&"'!H8:H1000"))=1))),INDIREC T("'"&A3&"'!I8:I1000"))

however this returns a #VALUE! error. I have also tried JANUARY instead of 1
for the month criteria - same result.

If anyone could help me on this I would be very grateful. TIA.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default SUMPRODUCT, INDIRECT, dates...

Try something like this:

=SUMPRODUCT(--(TEXT(INDIRECT("'"&A3&"'!H8:H1000"),"yyyy/m")="2008/1"),INDIRECT("'"&A3&"'!I8:I1000"))

--
Biff
Microsoft Excel MVP


"LongTermNoob" wrote in message
...
Hi,

I recently asked for help looking up values in one column by the year in
another column on different worksheets, and was very kindly given the
following solution:

=SUMPRODUCT(--(YEAR(INDIRECT("'"&A3&"'!H8:H1000"))=2008),INDIREC T("'"&A3&"'!I8:I1000"))

I have now been asked to add sub-totals by month! I came up with:

=SUMPRODUCT(AND(--(YEAR(INDIRECT("'"&A3&"'!H8:H1000"))=2008),(--(MONTH(INDIRECT("'"&A3&"'!H8:H1000"))=1))),INDIREC T("'"&A3&"'!I8:I1000"))

however this returns a #VALUE! error. I have also tried JANUARY instead of
1
for the month criteria - same result.

If anyone could help me on this I would be very grateful. TIA.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default SUMPRODUCT, INDIRECT, dates...

Thanks, Biff, this works a treat!

Out of curiosity, is there any reason I couldn't do it with the AND
statement? Or does it just make things too complicated?

Thanks again,
Roger


"T. Valko" wrote:

Try something like this:

=SUMPRODUCT(--(TEXT(INDIRECT("'"&A3&"'!H8:H1000"),"yyyy/m")="2008/1"),INDIRECT("'"&A3&"'!I8:I1000"))

--
Biff
Microsoft Excel MVP


"LongTermNoob" wrote in message
...
Hi,

I recently asked for help looking up values in one column by the year in
another column on different worksheets, and was very kindly given the
following solution:

=SUMPRODUCT(--(YEAR(INDIRECT("'"&A3&"'!H8:H1000"))=2008),INDIREC T("'"&A3&"'!I8:I1000"))

I have now been asked to add sub-totals by month! I came up with:

=SUMPRODUCT(AND(--(YEAR(INDIRECT("'"&A3&"'!H8:H1000"))=2008),(--(MONTH(INDIRECT("'"&A3&"'!H8:H1000"))=1))),INDIREC T("'"&A3&"'!I8:I1000"))

however this returns a #VALUE! error. I have also tried JANUARY instead of
1
for the month criteria - same result.

If anyone could help me on this I would be very grateful. TIA.




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default SUMPRODUCT, INDIRECT, dates...

You could also do it this way:

=SUMPRODUCT(--(YEAR(INDIRECT("'"&A3&"'!H8:H1000"))=2008),--(MONTH(INDIRECT("'"&A3&"'!H8:H1000"))=1),INDIRECT( "'"&A3&"'!I8:I1000")

The formula I suggested is a bit shorter.

--
Biff
Microsoft Excel MVP


"LongTermNoob" wrote in message
...
Thanks, Biff, this works a treat!

Out of curiosity, is there any reason I couldn't do it with the AND
statement? Or does it just make things too complicated?

Thanks again,
Roger


"T. Valko" wrote:

Try something like this:

=SUMPRODUCT(--(TEXT(INDIRECT("'"&A3&"'!H8:H1000"),"yyyy/m")="2008/1"),INDIRECT("'"&A3&"'!I8:I1000"))

--
Biff
Microsoft Excel MVP


"LongTermNoob" wrote in message
...
Hi,

I recently asked for help looking up values in one column by the year
in
another column on different worksheets, and was very kindly given the
following solution:

=SUMPRODUCT(--(YEAR(INDIRECT("'"&A3&"'!H8:H1000"))=2008),INDIREC T("'"&A3&"'!I8:I1000"))

I have now been asked to add sub-totals by month! I came up with:

=SUMPRODUCT(AND(--(YEAR(INDIRECT("'"&A3&"'!H8:H1000"))=2008),(--(MONTH(INDIRECT("'"&A3&"'!H8:H1000"))=1))),INDIREC T("'"&A3&"'!I8:I1000"))

however this returns a #VALUE! error. I have also tried JANUARY instead
of
1
for the month criteria - same result.

If anyone could help me on this I would be very grateful. TIA.






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default SUMPRODUCT, INDIRECT, dates...

Excellent. Many thanks again...

Roger

"T. Valko" wrote:

You could also do it this way:

=SUMPRODUCT(--(YEAR(INDIRECT("'"&A3&"'!H8:H1000"))=2008),--(MONTH(INDIRECT("'"&A3&"'!H8:H1000"))=1),INDIRECT( "'"&A3&"'!I8:I1000")

The formula I suggested is a bit shorter.

--
Biff
Microsoft Excel MVP


"LongTermNoob" wrote in message
...
Thanks, Biff, this works a treat!

Out of curiosity, is there any reason I couldn't do it with the AND
statement? Or does it just make things too complicated?

Thanks again,
Roger


"T. Valko" wrote:

Try something like this:

=SUMPRODUCT(--(TEXT(INDIRECT("'"&A3&"'!H8:H1000"),"yyyy/m")="2008/1"),INDIRECT("'"&A3&"'!I8:I1000"))

--
Biff
Microsoft Excel MVP


"LongTermNoob" wrote in message
...
Hi,

I recently asked for help looking up values in one column by the year
in
another column on different worksheets, and was very kindly given the
following solution:

=SUMPRODUCT(--(YEAR(INDIRECT("'"&A3&"'!H8:H1000"))=2008),INDIREC T("'"&A3&"'!I8:I1000"))

I have now been asked to add sub-totals by month! I came up with:

=SUMPRODUCT(AND(--(YEAR(INDIRECT("'"&A3&"'!H8:H1000"))=2008),(--(MONTH(INDIRECT("'"&A3&"'!H8:H1000"))=1))),INDIREC T("'"&A3&"'!I8:I1000"))

however this returns a #VALUE! error. I have also tried JANUARY instead
of
1
for the month criteria - same result.

If anyone could help me on this I would be very grateful. TIA.









  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default SUMPRODUCT, INDIRECT, dates...

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"LongTermNoob" wrote in message
...
Excellent. Many thanks again...

Roger

"T. Valko" wrote:

You could also do it this way:

=SUMPRODUCT(--(YEAR(INDIRECT("'"&A3&"'!H8:H1000"))=2008),--(MONTH(INDIRECT("'"&A3&"'!H8:H1000"))=1),INDIRECT( "'"&A3&"'!I8:I1000")

The formula I suggested is a bit shorter.

--
Biff
Microsoft Excel MVP


"LongTermNoob" wrote in message
...
Thanks, Biff, this works a treat!

Out of curiosity, is there any reason I couldn't do it with the AND
statement? Or does it just make things too complicated?

Thanks again,
Roger


"T. Valko" wrote:

Try something like this:

=SUMPRODUCT(--(TEXT(INDIRECT("'"&A3&"'!H8:H1000"),"yyyy/m")="2008/1"),INDIRECT("'"&A3&"'!I8:I1000"))

--
Biff
Microsoft Excel MVP


"LongTermNoob" wrote in
message
...
Hi,

I recently asked for help looking up values in one column by the
year
in
another column on different worksheets, and was very kindly given
the
following solution:

=SUMPRODUCT(--(YEAR(INDIRECT("'"&A3&"'!H8:H1000"))=2008),INDIREC T("'"&A3&"'!I8:I1000"))

I have now been asked to add sub-totals by month! I came up with:

=SUMPRODUCT(AND(--(YEAR(INDIRECT("'"&A3&"'!H8:H1000"))=2008),(--(MONTH(INDIRECT("'"&A3&"'!H8:H1000"))=1))),INDIREC T("'"&A3&"'!I8:I1000"))

however this returns a #VALUE! error. I have also tried JANUARY
instead
of
1
for the month criteria - same result.

If anyone could help me on this I would be very grateful. TIA.









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 indirect BNT1 via OfficeKB.com Excel Worksheet Functions 5 November 25th 07 06:23 PM
SUMPRODUCT & INDIRECT? lou031205 Excel Worksheet Functions 4 November 4th 07 02:07 AM
Need help with using SUMPRODUCT with INDIRECT anara Excel Worksheet Functions 1 January 22nd 06 05:08 PM
Help with Sumproduct with Indirect Rob Excel Worksheet Functions 6 July 28th 05 09:03 PM
sumproduct & indirect floridasurfn Excel Worksheet Functions 3 March 14th 05 02:01 AM


All times are GMT +1. The time now is 04:39 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"