Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Russ
 
Posts: n/a
Default indirect function?

I'm using Office 2000. I would like to use a cell in my spreadsheet
to indicate a row number for other cell's formulas. That is, I would
enter a row number (not a full cell address) in a certain cell, and
other cells would access that cell and insert that row number in their
own formula. I've thought about combining the indirect function, and
the address function, but I don't know how to accomplish this. For
example, the cells that need the info would have a formula something
like this:

=sum(indirect(A1):indirect(A2))

Problem is, I want each column's formula to indicate it's own column,
not the column in cell A1 or A2.

Any way to do this?

Russ
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Perhaps you mean

=SUM(INDIRECT("A"&B1&":A"&B2))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Russ" wrote in message
...
I'm using Office 2000. I would like to use a cell in my spreadsheet
to indicate a row number for other cell's formulas. That is, I would
enter a row number (not a full cell address) in a certain cell, and
other cells would access that cell and insert that row number in their
own formula. I've thought about combining the indirect function, and
the address function, but I don't know how to accomplish this. For
example, the cells that need the info would have a formula something
like this:

=sum(indirect(A1):indirect(A2))

Problem is, I want each column's formula to indicate it's own column,
not the column in cell A1 or A2.

Any way to do this?

Russ



  #3   Report Post  
Russ
 
Posts: n/a
Default


On Thu, 28 Jul 2005 16:06:46 +0100, "Bob Phillips"
wrote:

Perhaps you mean

=SUM(INDIRECT("A"&B1&":A"&B2))



I tried your solution but Excel didn't like it. I re-arranged the
quotes and ampersands but could not get it to go. Got any explanation
for this one?

Russ

  #4   Report Post  
Roger Govier
 
Posts: n/a
Default

Bob's solution works fine.
What are you entering in B1 and B2? What error are you getting?
With 13 in B1 and 15 in B2 and the values 10,20,30 in cells A13, A14 and A15
I get the correct result of 60.

--
Regards
Roger Govier
"Russ" wrote in message
...

On Thu, 28 Jul 2005 16:06:46 +0100, "Bob Phillips"
wrote:

Perhaps you mean

=SUM(INDIRECT("A"&B1&":A"&B2))



I tried your solution but Excel didn't like it. I re-arranged the
quotes and ampersands but could not get it to go. Got any explanation
for this one?

Russ



  #5   Report Post  
Russ
 
Posts: n/a
Default

After following your explanation I see that Bob's solution does work
fine. I was and still am unsure of the reasons for the quotes and
ampersands and why they go where they do, but I plugged in my columns
and rows and got it going just fine. All it needs is some way to
indicate a relative address for each column so I can copy the formula
across columns easily. Thanks for the help.

On Fri, 29 Jul 2005 10:49:07 +0100, "Roger Govier"
wrote:

Bob's solution works fine.
What are you entering in B1 and B2? What error are you getting?
With 13 in B1 and 15 in B2 and the values 10,20,30 in cells A13, A14 and A15
I get the correct result of 60.




  #6   Report Post  
Bob Phillips
 
Posts: n/a
Default

Russ,

INDIRECT is looking for a string (that it can INDIRECT to). So the formula
builds up the string bit by bit

"A" - to signify the start column, A
&B1 - concatenate with that A, the row number in cell B1
":A" - : for a range separator, A for then end column, A again
&B1 - concatenate with that :A, the row number in cell B2

giving us a range string, such as A2:A23. which INDIRECT works upon

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Russ" wrote in message
...
After following your explanation I see that Bob's solution does work
fine. I was and still am unsure of the reasons for the quotes and
ampersands and why they go where they do, but I plugged in my columns
and rows and got it going just fine. All it needs is some way to
indicate a relative address for each column so I can copy the formula
across columns easily. Thanks for the help.

On Fri, 29 Jul 2005 10:49:07 +0100, "Roger Govier"
wrote:

Bob's solution works fine.
What are you entering in B1 and B2? What error are you getting?
With 13 in B1 and 15 in B2 and the values 10,20,30 in cells A13, A14 and

A15
I get the correct result of 60.




  #7   Report Post  
Russ
 
Posts: n/a
Default

On Fri, 29 Jul 2005 23:08:12 +0100, "Bob Phillips"
wrote:

Thanks Bob, I never would've figured this out. I didn't find anything
like this in Excel's help files, but maybe it's buried deeper
somewhere.

Russ

Russ,

INDIRECT is looking for a string (that it can INDIRECT to). So the formula
builds up the string bit by bit

"A" - to signify the start column, A
&B1 - concatenate with that A, the row number in cell B1
":A" - : for a range separator, A for then end column, A again
&B1 - concatenate with that :A, the row number in cell B2

giving us a range string, such as A2:A23. which INDIRECT works upon


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 impact on Copy Worksheet BG Excel Worksheet Functions 5 July 13th 05 02:29 AM
Excel option to store trendline's coefficients in cells for use Miguel Saldana Charts and Charting in Excel 9 June 20th 05 08:45 PM
Using INDIRECT function to specify source data donesquire Charts and Charting in Excel 2 May 27th 05 03:53 AM
referencing named formula using INDIRECT function [email protected] Excel Worksheet Functions 19 May 11th 05 09:48 AM
Sum Indirect function through multiple sheets Andre Croteau Excel Discussion (Misc queries) 2 May 6th 05 10:44 AM


All times are GMT +1. The time now is 02:10 AM.

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"