Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default Range Reference

In the formula:

=AVERAGE(A1:A13)

I would like to be able to change the 13 to other values from a single cell
located in a different part of the spreadsheet by just entering a different
number in that cell. In other words to change the range from separate cell.
Can I do that without using a macro....kinda new at this. Many thanks.

Jerry
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Range Reference

if you put a6 for example, in b1 and run this, it will but the average of A1:a6
in c1

sub test
Range("C1").Formula = "=average(a1:" & Range("b1").Value & ")"
end sub

just qualify the range with the sheet name and change the locations to your
preference

--


Gary


"Jerry" wrote in message
...
In the formula:

=AVERAGE(A1:A13)

I would like to be able to change the 13 to other values from a single cell
located in a different part of the spreadsheet by just entering a different
number in that cell. In other words to change the range from separate cell.
Can I do that without using a macro....kinda new at this. Many thanks.

Jerry



  #3   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Range Reference

try:
=Average(Indirect("A1:A"&B1))

where B1 = 13. since you are not looking for a macro, the worksheet
function category probably would have been a better choice to post than the
programming section.


"Jerry" wrote:

In the formula:

=AVERAGE(A1:A13)

I would like to be able to change the 13 to other values from a single cell
located in a different part of the spreadsheet by just entering a different
number in that cell. In other words to change the range from separate cell.
Can I do that without using a macro....kinda new at this. Many thanks.

Jerry

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default Range Reference

Thanks for your help and advice.

Jerry

"Jerry" wrote:

In the formula:

=AVERAGE(A1:A13)

I would like to be able to change the 13 to other values from a single cell
located in a different part of the spreadsheet by just entering a different
number in that cell. In other words to change the range from separate cell.
Can I do that without using a macro....kinda new at this. Many thanks.

Jerry

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
automatic range - named range give me circular reference... George Thorogood Excel Discussion (Misc queries) 0 February 22nd 07 07:53 PM
Help with Range Reference Mike Excel Programming 2 April 25th 06 10:50 PM
Can you get the range reference for each page in a worksheet print range? Crosby Excel Programming 3 April 12th 05 06:06 PM
adding reference-to-range control to excel range Nir Sfez Excel Programming 1 March 2nd 04 06:11 PM
Subscript out of Range on Range reference Tom Ogilvy Excel Programming 0 September 13th 03 03:38 PM


All times are GMT +1. The time now is 04:13 PM.

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"