Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Stopping a Formula from Updating References.
Written by Allen Wyatt (last updated September 28, 2022)
This tip applies to Excel 97, 2000, 2002, and 2003
David wonders if there is a way he can make a formula not automatically update when he inserts a column that would otherwise affect the formula. For instance, if he has the formula =SUM(B:B) and then he inserts a column to the left of column B, the formula is automatically updated by Excel to =SUM(C:C). He doesn't want the formula to update; he still wants it to refer to column B after he inserts the new column.
One way to get the result you want is to use the OFFSET function to refer to column B. For instance, consider the following formula:
=SUM(OFFSET(A:A,0,1))
If this formula is in a cell, and you insert a column before column B, then the formula doesn't update; it still refers to column B. Why? Because the formula refers to column A and you didn't do anything to move column A. If you did insert a column before column A, then the formula would update to reference column B.
This means that the best way to handle the formula is to use the INDIRECT function, in this manner:
=SUM(INDIRECT("B:B"))
The INDIRECT function uses text for a parameter, and since it is text it is not considered a reference to be updated by Excel. Regardless of inserting or deleting columns, the formula will always refer to column B.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3392) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Stopping a Formula from Updating References.
Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!
When using an Excel worksheet to store data (such as names and phone numbers), you may need a way to easily look up a ...
Discover MoreThe formulas in your worksheet can be displayed (instead of formula results) by a simple configuration change. You can ...
Discover MoreText placed in cells can either be lowercase, uppercase, or a mixture of the two. If you want to count the cells based ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2021-10-13 12:49:47
Ian
Hi Allen,
I just had to take a minute to let you know how incredibly helpful this was. For years I have been maintaining an Excel document where I have to add rows to the TOP of the sheet every week, thus breaking some fixed row information at the very top which I then have to spend time fixing... every week. This "INDIRECT" function is a lifesaver.
I very much appreciate the time you took to write this and other helpful Excel tips. You are definitely helping people!
--Ian
Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments