Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Grymjack
 
Posts: n/a
Default sum() using indirect()

Can anyone post a formula that successfully uses
SUM(INDIRECT("concatenated cell range")) where the path isn't local to
the sheet it is on?

ex:

A1 = [TestBook.xls]Sheet1!B1
A2 = [TestBook.xls]Sheet1!B10

=SUM(INDIRECT(A1&":"&A2))

.....can you get that one to work??
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default sum() using indirect()

Hi!

Make the 2nd reference just the cell address:

A1 = [TestBook.xls]Sheet1!B1
A2 = B10

=SUM(INDIRECT(A1&":"&A2))

Or, put the path in one cell and the cell references in other cells:

A1 = [TestBook.xls]Sheet1!
A2 = B1
A3 = B10

=SUM(INDIRECT(A1&A2&":"&A3))

Just note that the other file HAS to be open for this to work. If it's not
open you'll get a #REF! error.

Biff

"Grymjack" wrote in message
...
Can anyone post a formula that successfully uses
SUM(INDIRECT("concatenated cell range")) where the path isn't local to the
sheet it is on?

ex:

A1 = [TestBook.xls]Sheet1!B1
A2 = [TestBook.xls]Sheet1!B10

=SUM(INDIRECT(A1&":"&A2))

....can you get that one to work??



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Grymjack
 
Posts: n/a
Default sum() using indirect()

Thanks Biff,
That did it!! Though I'm at kind of a loss why that will work when the
full path variable wont!?!

-Dan

Biff wrote:
Hi!

Make the 2nd reference just the cell address:

A1 = [TestBook.xls]Sheet1!B1
A2 = B10

=SUM(INDIRECT(A1&":"&A2))

Or, put the path in one cell and the cell references in other cells:

A1 = [TestBook.xls]Sheet1!
A2 = B1
A3 = B10

=SUM(INDIRECT(A1&A2&":"&A3))

Just note that the other file HAS to be open for this to work. If it's not
open you'll get a #REF! error.

Biff

"Grymjack" wrote in message
...
Can anyone post a formula that successfully uses
SUM(INDIRECT("concatenated cell range")) where the path isn't local to the
sheet it is on?

ex:

A1 = [TestBook.xls]Sheet1!B1
A2 = [TestBook.xls]Sheet1!B10

=SUM(INDIRECT(A1&":"&A2))

....can you get that one to work??



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove
 
Posts: n/a
Default sum() using indirect()

Grymjack wrote...
....
That did it!! Though I'm at kind of a loss why that will work when the
full path variable wont!?!

....
A1 = [TestBook.xls]Sheet1!B1
A2 = [TestBook.xls]Sheet1!B10

=SUM(INDIRECT(A1&":"&A2))

....

Remove the SUM and INDIRECT calls and =A1&":"&A2 gives

[TestBook.xls]Sheet1!B1:[TestBook.xls]Sheet1!B10

This *is* a valid reference *EXPRESSION* if used directly in a formula.
That is, if TestBook.xls were open, the formula

=SUM([TestBook.xls]Sheet1!B1:[TestBook.xls]Sheet1!B10)

would return the same result as

=SUM([TestBook.xls]Sheet1!B1:B10)

But that's due to ambiguity in Excel's reference syntax. Colon, :, is
overloaded. It's used both in single area range references like B1:B10
and as a range accumulation operator in range references like A4:C5:F3,
which is equivalent to A3:F5. A rule of thumb is that when there's only
one colon in a range reference, and the right side of the range
reference is just a cell reference with no workbook/worksheet portion,
then the range reference is treated like a constant, but if there are
multiple colons or any cell reference to the right of any of the colons
includes a workbook/worksheet portion, the range reference is treated
like an expression. INDIRECT can handle range 'constants' but not range
'expressions', meaning what's on the right of the colon can only be a
simple cell address.

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 Range Referencing jeaton Charts and Charting in Excel 0 February 10th 06 02:25 PM
Copying a formulae down a column that includes an INDIRECT A.Webb Excel Discussion (Misc queries) 10 January 14th 06 03:42 AM
Using the Indirect function with a sheet number instead of a sheet name JDB Excel Worksheet Functions 5 December 31st 05 03:03 PM
Indirect function - Limitations Ken Cobler Excel Worksheet Functions 2 September 16th 05 04:59 PM
referencing named formula using INDIRECT function [email protected] Excel Worksheet Functions 19 May 11th 05 09:48 AM


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