Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Keeping Formulas the same when inserting columns

I have a spreadsheet where colum B is =AVERAGE(C2:H2) , which is the average
of 6 weeks of data. Every week I'll insert a new column at C. I want the
formula in column B to always be what is above, however, when I insert a new
column Excel thinks for itself and changes the formual in B to
=AVERAGE(D2:I2).

Does anyone know how to keep the formula to always read the cell reference
that is listed in there?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 347
Default Keeping Formulas the same when inserting columns

Hi,

One way is to use the indirect function:

=AVERAGE(INDIRECT("C2:H2"))

or if you need to copy down

=AVERAGE(INDIRECT("C"&ROW(A2)&":H"&ROW(A2)))

HTH
Jean-Guy

"rhonda stringfellow" wrote:

I have a spreadsheet where colum B is =AVERAGE(C2:H2) , which is the average
of 6 weeks of data. Every week I'll insert a new column at C. I want the
formula in column B to always be what is above, however, when I insert a new
column Excel thinks for itself and changes the formual in B to
=AVERAGE(D2:I2).

Does anyone know how to keep the formula to always read the cell reference
that is listed in there?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 46
Default Keeping Formulas the same when inserting columns

Because you're doing this every week, you can automate the entire
process with a macro. As part of that macro, you might convert the
=AVERAGE(C2:H2) formula to a text string by replacing the = sign with
your initials, inserting the column, and then replacing your initials
with the = sign to convert it back to a dynamic formula. This method
works when there is a range of formulas to change. If there's only one
formula you might use this line in your macro:
Range("B15").formula = "=AVERAGE(C2:H2)"
(You'll need to change the B15 reference to the proper cell address,
of course.)

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
Inserting new row but keeping formulae Alex Simpson Excel Worksheet Functions 0 August 8th 06 01:16 PM
Adding columns w/new formulas BUT keeping subtotals Exceldawg Excel Discussion (Misc queries) 0 April 19th 06 02:58 PM
Help with keeping formulas in place! tapuza Excel Discussion (Misc queries) 2 December 23rd 05 07:24 PM
Inserting Columns and Formulas updating Jaime Balance Sheet Excel Worksheet Functions 1 May 2nd 05 02:02 PM
Formulas: Keeping same row/column reference when columns are inser Mike Excel Discussion (Misc queries) 5 February 11th 05 09:37 PM


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