Filling Cells with Decreasing Cell References

Written by Allen Wyatt (last updated March 2, 2024)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


1

Adam has two formulas in cells A1 and A2. In A1 he has the formula =B150 and in cell A2 he has the formula =B149. He tried to copy this sequence downward, using the fill handle, but the sequence wouldn't work right. (For instance, after filling cell A3 contained =B152 when it should have contained =B148.) Adam wonders if there is a way to have such a fill work properly.

Adam is right; filling will not work in this instance. The reason is because the fill feature in Excel works with values, not with formulas. So, there are a couple of ways you can approach this problem.

The first is to place text values of some sort into cells A1 and A2. For instance, you could place the text "x=B150" (without the quotes) into cell A1 and "x=B149" (again, without the quotes) into cell A2. Excel rightfully parses these cells as text. You can then select A1:A2 and drag downward as far as you need. Excel follows the pattern in the text (remember, it isn't a formula) and decreases the numbers. (Don't drag past cell A150. When you hit A151 the text will be "x=B0" and then Excel starts counting upwards again in cell A152.)

Now, select all the cells that you just filled and use Find and Replace to search for the preface character (x) and replace it with nothing. You end up with the equal sign in the leading position, and Excel now parses the cells as formulas, just as you want.

Another approach is to use a more complex formula to accommodate the need of decreasing references. In this instance you can do it using the INDIRECT function, in this manner:

=INDIRECT("B"&151-ROW())

Paste this into cell A1 and then copy it down through cell A150. It works because you are subtracting the current row number from 151, adding a "B" to the front of it, and then using INDIRECT to reference the value in that calculated cell address. Obviously, if you want to reference a different cell (other than starting with B150), you'll need to adjust the formula so that the proper cell address is calculated.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (8443) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Calculating the Distance between Points

Want to figure out how far it is between two points on the globe? If you know the points by latitude and longitude, you ...

Discover More

Saving Personalized Copies of a Document

Need a series of documents that include an individual's name or a company name? Here's a handy little macro that will ...

Discover More

Last Document Saves Not Saved

Click the Save button and you expect your document to be saved, right? What if you later discover it wasn't really saved? ...

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

More ExcelTips (ribbon)

Address of a Cell in Which a Threshold is Exceeded

If you keep a lot of data in Excel, you may be interested in figuring out when that data surpasses a threshold. This tip ...

Discover More

Hiding Rows Based on Two Values

It's easy to use filtering to hide rows based on the value in a cell, but how do you hide rows based on the values in two ...

Discover More

Moving the House Number to Its Own Cell

Excel is great at manipulating data, but sometimes it is difficult to figure out the best way to do the manipulation. ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 7 + 0?

2024-03-05 10:17:18

J. Woolley

The Tip suggests the following formula:
    =INDIRECT("B"&151-ROW())
and says, "Paste this into cell A1 and then copy it down through cell A150."
Here is another formula that produces the same result:
    =OFFSET(B$151,-ROW(),0)
With credit to Alex B, since INDIRECT and OFFSET are both volatile consider the following non-volatile formula instead:
    =INDEX(B$1:B$150,151-ROW())
See https://bettersolutions.com/excel/functions/volatile-functions.htm


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.