Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Tightlines
 
Posts: n/a
Default How to 'Calculate' an Excel Reference

I'm trying to determine how I can easily change a cell reference in a formula
to a different value based on a calculation in my spreadsheet.

For example:

I have the formula Sum(A1:A10)

In reality, I would like the formula to change depending on the value in
another cell (say cell B1) so that when B1 = 54, the formula becomes
Sum(A1:A54). Is there a way I can change the reference in the formula in
this manner using cell values or constants?
  #2   Report Post  
David Billigmeier
 
Posts: n/a
Default

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


--
Regards,
Dave


"Tightlines" wrote:

I'm trying to determine how I can easily change a cell reference in a formula
to a different value based on a calculation in my spreadsheet.

For example:

I have the formula Sum(A1:A10)

In reality, I would like the formula to change depending on the value in
another cell (say cell B1) so that when B1 = 54, the formula becomes
Sum(A1:A54). Is there a way I can change the reference in the formula in
this manner using cell values or constants?

  #4   Report Post  
Tightlines
 
Posts: n/a
Default

Thanks,

That helped - how would it work if I wanted to make both of the references
in the formula using the INDIRECT function? (so I would have A1 determined by
a value in B1 and A10 determined by a value in B2)?

"Tightlines" wrote:

I'm trying to determine how I can easily change a cell reference in a formula
to a different value based on a calculation in my spreadsheet.

For example:

I have the formula Sum(A1:A10)

In reality, I would like the formula to change depending on the value in
another cell (say cell B1) so that when B1 = 54, the formula becomes
Sum(A1:A54). Is there a way I can change the reference in the formula in
this manner using cell values or constants?

  #5   Report Post  
Sloth
 
Posts: n/a
Default

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

Just look at what the function is doing and you should be able to figure it
out.

From Help: "[Indirect] Returns the reference specified by a text string."

The "&" charector is how you combine text strings.

So you are just taking the values in B1 and B2 and converting them to text
strings to get the row references of the list. When you see a new formula,
look it up in the help to better understand what's going on. This helps you
to learn how to use the function properly and should answer any other
questions you have.

"Tightlines" wrote:

Thanks,

That helped - how would it work if I wanted to make both of the references
in the formula using the INDIRECT function? (so I would have A1 determined by
a value in B1 and A10 determined by a value in B2)?

"Tightlines" wrote:

I'm trying to determine how I can easily change a cell reference in a formula
to a different value based on a calculation in my spreadsheet.

For example:

I have the formula Sum(A1:A10)

In reality, I would like the formula to change depending on the value in
another cell (say cell B1) so that when B1 = 54, the formula becomes
Sum(A1:A54). Is there a way I can change the reference in the formula in
this manner using cell values or constants?



  #6   Report Post  
David Billigmeier
 
Posts: n/a
Default

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

--
Regards,
Dave


"Tightlines" wrote:

Thanks,

That helped - how would it work if I wanted to make both of the references
in the formula using the INDIRECT function? (so I would have A1 determined by
a value in B1 and A10 determined by a value in B2)?

"Tightlines" wrote:

I'm trying to determine how I can easily change a cell reference in a formula
to a different value based on a calculation in my spreadsheet.

For example:

I have the formula Sum(A1:A10)

In reality, I would like the formula to change depending on the value in
another cell (say cell B1) so that when B1 = 54, the formula becomes
Sum(A1:A54). Is there a way I can change the reference in the formula in
this manner using cell values or constants?

  #7   Report Post  
RagDyer
 
Posts: n/a
Default

Another way:

=SUM(INDEX(A:A,B1):INDEX(A:A,B2))

--
HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


"Tightlines" wrote in message
...
Thanks,

That helped - how would it work if I wanted to make both of the references
in the formula using the INDIRECT function? (so I would have A1 determined

by
a value in B1 and A10 determined by a value in B2)?

"Tightlines" wrote:

I'm trying to determine how I can easily change a cell reference in a

formula
to a different value based on a calculation in my spreadsheet.

For example:

I have the formula Sum(A1:A10)

In reality, I would like the formula to change depending on the value in
another cell (say cell B1) so that when B1 = 54, the formula becomes
Sum(A1:A54). Is there a way I can change the reference in the formula

in
this manner using cell values or constants?


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
Is it possible to calculate integrals with Excel? Francesco Excel Worksheet Functions 6 April 2nd 23 08:56 PM
Does Excel use least squares regression to calculate trendlines? Trendy Charts and Charting in Excel 3 May 20th 05 07:03 AM
Excel should have a absolute reference cell property. Unitrip Excel Discussion (Misc queries) 5 March 27th 05 04:55 PM
Does Excel 2000 have a 'datedif' function to calculate the number. Kaddy Excel Worksheet Functions 7 December 11th 04 08:53 PM
using a reference in vlookup with excel 2003 Gord Dibben Excel Worksheet Functions 0 October 28th 04 01:27 AM


All times are GMT +1. The time now is 08:29 PM.

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"