Fixing a formula - need to find & replace a single digit

Burrgogi

Active Member
Joined
Nov 3, 2005
Messages
495
Office Version
  1. 2010
Platform
  1. Windows
I have a spreadsheet that I created long ago. One of the cells contains this formula which I need to fix:

Excel Formula:
=SUM(B12-B11)/ABS(B11)

It's referencing the wrong row, so I need to correct it to this:

Excel Formula:
=SUM(B11-B10)/ABS(B10)

In essence, all the row numbers need to be decreased by 1.

If it was just this single cell, it would be alright to do manually but it compares 2024 data with 2023 data so I've got 12 months to fix. Plus the data goes back to 2016 with the same comparisons so there are a total of 110 formulas that I need to fix like this.

I had the idea of replacing the equal sign with the '#' symbol. Basically convert the formula to a text string so I could do a simple text string 'find & replace' operation.

But I'm lost as to how to fix this in the most efficient manner.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Find and Replace can look in formulas (unless it's not an option in 2010):
1716394088998.png
 
Upvote 0
Find and Replace can look in formulas (unless it's not an option in 2010):
View attachment 111772

Yes, I well aware that option exists. My challege is how to fix all 110 formulas in the manner I described. The columns that are in the formula are correct. However all the row numbers need to be shifted up by 1.
 
Upvote 0
Yes, I well aware that option exists. My challege is how to fix all 110 formulas in the manner I described. The columns that are in the formula are correct. However all the row numbers need to be shifted up by 1.
I'm not sure I understand the disconnect here... do a find/replace on all the formulas and change the row 11 to row 10, then do a second find/replace on all the formulas and change the row 12 to row 11. Unless of course, that sample formula is not the same in all cells and the row numbers are not all 11 and 12?
 
Upvote 0
Are the formulas in one column, multiple columns, or not consistent (all over the sheet)?
 
Upvote 0
Are the formulas in one column, multiple columns, or not consistent (all over the sheet)?

All over the sheet.

What I had in mind when I posted this thread was a find & replace operation that could ignore the column letters and just decrease all the row numbers by 1.
Example:
=SUM(#5-#4)/ABS(#4)
=SUM(#4-#3)/ABS(#3)

But that wasn't working out at all.

After I posted, I had an idea that came to me. Using my aforementioned method (replacing = with #) I copied all the cells containing the erroneous formula and pasted them one row lower from the original spot. Then I replaced # with the equal sign, making them formulas again. From there, it was just a matter of fixing just the oldest year only so I only had to fix 12 of them manually.
 
Upvote 0
All over the sheet.

What I had in mind when I posted this thread was a find & replace operation that could ignore the column letters and just decrease all the row numbers by 1.
Example:
=SUM(#5-#4)/ABS(#4)
=SUM(#4-#3)/ABS(#3)

But that wasn't working out at all.

After I posted, I had an idea that came to me. Using my aforementioned method (replacing = with #) I copied all the cells containing the erroneous formula and pasted them one row lower from the original spot. Then I replaced # with the equal sign, making them formulas again. From there, it was just a matter of fixing just the oldest year only so I only had to fix 12 of them manually.
Ah, okay then, sounds like you got it resolved.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,219
Members
452,619
Latest member
Shiv1198

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top