Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Nickneem
 
Posts: n/a
Default Indirect in combination with ROW

If created a formula a while ago in which I refer to sheets with names
like 1 and 2 -- ROW($1:$2) this way I get a correct amount from the
sumproduct formula.

=SUMPRODUCT(SUMIF(INDIRECT("'" & ROW($1:$2) & "'!A2:Z1000"),
$A4,INDIRECT("'" & ROW($1:$2) & "'!B2:B1000")))

I want to rename the sheets to something which makes more sense but if
I try that (like for instance to sheet1) my formula returns an error?

Thanks in advance,

Mike

  #2   Report Post  
Harlan Grove
 
Posts: n/a
Default Indirect in combination with ROW

"Nickneem" wrote...
If created a formula a while ago in which I refer to sheets with names
like 1 and 2 -- ROW($1:$2) this way I get a correct amount from the
sumproduct formula.

=SUMPRODUCT(SUMIF(INDIRECT("'" & ROW($1:$2) & "'!A2:Z1000"),
$A4,INDIRECT("'" & ROW($1:$2) & "'!B2:B1000")))

I want to rename the sheets to something which makes more sense but if
I try that (like for instance to sheet1) my formula returns an error?


Your original formula worked because ROW($1:$2) returned the actual
worksheet names as an array, {1;2}. If you want to change your worksheet
names, you'd need to change the formula so that instead of ROW($1:$2) it
uses something else that returns an array of the worksheet names. Simplest
would be to enter the new worksheet names in a range, e.g., X99:x100, then
refer to that range instead.

=SUMPRODUCT(SUMIF(INDIRECT("'"&$X$99:$X$100&"'!A2: Z1000"),
$A4,INDIRECT("'"&$X$99:$X$100&"'!B2:B1000")))


  #3   Report Post  
Nickneem
 
Posts: n/a
Default Indirect in combination with ROW

Thanks Harlan, so if I understand it correct I can't have my sheet
named like "Inv Japan", "Inv UK", "Inv USA", etc?
I really have to dig deeper into this sumproduct / indirect thing, I've
set it up once but now it looks all abracadabra to me after a couple of
months.

Thanks for your help!

Michael

  #4   Report Post  
Harlan Grove
 
Posts: n/a
Default Indirect in combination with ROW

"Nickneem" wrote...
Thanks Harlan, so if I understand it correct I can't have my sheet
named like "Inv Japan", "Inv UK", "Inv USA", etc?
I really have to dig deeper into this sumproduct / indirect thing, I've
set it up once but now it looks all abracadabra to me after a couple of
months.


No. You can name your worksheets anything you want, but unless you name them
as whole numbers between 1 and 65536 you can't use ROW to generate an array
of worksheet names.

If you enter the following into X99:X102,

Inv Japan
Inv UK
Inv USA
Inv Mars Colony

and these are names of worksheets with identical layouts, then you can use
the formula

=SUMPRODUCT(SUMIF(INDIRECT("'"&$X$99:$X$102&"'!A2: Z1000"),
$A4,INDIRECT("'"&$X$99:$X$102&"'!B2:B1000")))

to sum the entries in all of these worksheets' B2:B1000 ranges where the
corresponding cell in column A of the respective worksheets matches the
value of cell A4 in the worksheet containing this formula.

So you just need to replace the ROW(..) call with something that evaluates
to an array of the names of the worksheets over which you want to sum
conditionally.




  #5   Report Post  
Nickneem
 
Posts: n/a
Default Indirect in combination with ROW

Thanks a million Harlan, works perfectly!

Michael



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
Indirect function - Limitations Ken Cobler Excel Worksheet Functions 2 September 16th 05 04:59 PM
Find the combination of numbers that when added equal a reqired total?? Handsy11 Excel Worksheet Functions 5 July 12th 05 04:55 PM
referencing named formula using INDIRECT function [email protected] Excel Worksheet Functions 19 May 11th 05 09:48 AM
"combination drop-down edit " form activation in Excel Trev Excel Discussion (Misc queries) 1 March 4th 05 03:26 AM
is there a NON-volatile version of INDIRECT ?? spiderman Excel Discussion (Misc queries) 1 February 4th 05 04:54 PM


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