Excel formula does not self adjust.

dagda13

Board Regular
Joined
May 18, 2019
Messages
52
Hi,

I have following cells:

Original ValueAdjusted Value
AA
A
BB



In column B, "Adjusted Value", I have the following formula in each cell to eliminate any duplicates in column A:

=IF(A2=A1,"",A2)
=IF(A3=A2,"",A3)
=IF(A4=A3,"",A4)

The problem occurs when I delete row 3 (the one with the blank value cell B3).

The formulas in column B do not adjust. Instead, I get the #REF! error:

Original ValueAdjusted Value
AA
B
#REF!​

The formula in cell B3 is now:

=IF(A3=#REF!,"",A3)

When I delete row 3, shouldn't the formula automatically adjust to:

=IF(A3=A2,"",A3) ?

Why doesn't this happen? Is there anyway to set things up so the formulas will automatically adjust and not return a #REF! error?

My settings are on Automatic: Formulas ----> Calculation Options ----> Automatic.

Unfortunately, in my particular situation, I can't just remove the formulas and work with just the values. I need to able to delete rows with formulas that do not return #REF! errors.

Thanks in advance!
 
Last edited:

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
When I delete row 3, shouldn't the formula automatically adjust to:
When you delete row 3, the row is gone, row 4 moves up to take it's place. The remaining formulas below adjust, but any that refer to the row (or column) that has been deleted will return the #REF! error.

I think that you can work around it by using

=IF(A2=INDEX(A:A,ROW(A2)-1),"",A2)
 
Upvote 0
How about
=IF(INDEX(A:A,ROWS(A$1:A1))=A2,"",A2)
 
Upvote 0
A$2:A2 would be better, Fluff. While unlikely, yours could still result in #REF! if row 1 is deleted.
 
Upvote 0
When you delete row 3, the row is gone, row 4 moves up to take it's place. The remaining formulas below adjust, but any that refer to the row (or column) that has been deleted will return the #REF! error.

I think that you can work around it by using

=IF(A2=INDEX(A:A,ROW(A2)-1),"",A2)

Thanks so much, Jason. This is exactly what I needed!

Best,
Nick
 
Upvote 0

Forum statistics

Threads
1,215,332
Messages
6,124,314
Members
449,153
Latest member
JazzSingerNL

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