Below is the post by the late MVP George Simm
where he provided a detailed explanation and several formulas ..
(Link:
http://tinyurl.com/3yfgt )
Rgds,
Max
-----------------------------------------
Please reply in thread
Use xdemechanik <at>yahoo<dot>com for email
--------------------------------------------------------
From: George Simms (
[email protected])
Subject: Re: Array formula by George Simms
View: Complete Thread (2 articles)
Original Format
Newsgroups: microsoft.public.excel.worksheet.functions
Date: 2001-04-13 09:20:06 PST
Hi Hans,
Ok, a big push.
To use this formula the sheet names have to be numbered 1,2,3,......N .
ROW(INDIRECT(B2&":"&B3))
Returns an array of numbers specified in B2 and B3 , say B2 contains 2 and
B3 contains 7, this is ROW(2:7) and returns {2;3;4;5;6;7} this is
the sheet numbers you want to sum .
=SUM(N(INDIRECT({2;3;4;5;6;7}&"!A1")))
The second INDIRECT takes this array and turns it into references to each
sheet.
='2'!A1
='3'!A1
etc...... So changing the numbers in B2 or B3 allows you to dynamically
change the sheets to SUM.
Using N changes the array of references into an array of values, that can
be summed by the Sum function, although in the formula bar, using (F9) will
show the values.
If the Sheets are named Sheet1...Sheet2 etc......the formula can be changed
to:
=SUM(N(INDIRECT("Sheet"&ROW(INDIRECT(B2&":"&B3))&"!A1")))
Use Sumproduct instead of Sum, and formula now need not be array entered:
=SUMPRODUCT(N(INDIRECT("Sheet"&ROW(INDIRECT(B2&":"&B3))&"!A1")))
How about :
=SUM(SUMIF(OFFSET(INDIRECT(ROW(INDIRECT(B2&":"&B3))&"!A:A"),,),"<>"))
This will sum the contents of column A bounded by sheets specified in B2
and B3 .
The A:A could also be a range, say A1:A100.
Hope this explains.
All the Best
George Simms
Microsoft MVP - Excel
Newcastle upon Tyne
England.
in message ...
Hoping that George or someone else will give me a little push in fully
understanding his most valuable formula in David Hager's 10th issue of EEE.
This array formula returns the sum of cells in the 3D range bounded by the
sheets named in cells B2 and B3 (my comment: sheet names: 1, 2, 3, ...., n)
=SUM(N(INDIRECT(ROW(INDIRECT(B2&":"&B3))&"!A1")))
I note that the following part of the formula:
ROW(INDIRECT(B2&":"&B3))&"!A1"
returns {"1!A1"\"2!A1"}
I understand it so far, but I do not fully understand why it is necessary
to put these arguments into first another INDIRECT function and then the
N-function. I think George has explained this already somewhere but I do
not know what to search.
Hans Knudsen
-------------------------------------