View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove
 
Posts: n/a
Default How to programatically control a 3D-sum?

"Ake" wrote...
I have done
SUM(OFFSET(INDIRECT("Sheet"&number&"!E8")..etcete ra) to get a sum from a
specific sheet"number". It works as expected.
Now I want to extend this to get the sum of all sheets from sheet"0" to
sheet"number". However I try it seems that INDIRECT does not like a ":" and
gives me #REFERENCE.
Why can't I simply do
SUM(OFFSET(INDIRECT("Sheet0:Sheet"&number&"!E8"). .etcetera)
and how should I actually solve this task.


You can't do this because of formula syntax. In Excel, ranges are entirely
contained within single worksheets. 3D references aren't ranges. The OFFSET
function *requires* that its first argument be a range, and it returns #REF!
if it isn't.

As for workarounds, you'd need to show your entire formula.