Avoid !REF Errors

Sandy Radjenovic

Board Regular
Joined
Nov 4, 2003
Messages
76
I'm just not catching on with avoiding the #REF error. I realize why I am getting it but getting around it seems to be a problem.

I have formulas in columns that reference the columns above it. When I delete a row, the row below and thereafter contain #REF error because the referenced cell no longer exists.

My spreadsheet is as follows ...

Column P = date time ie P7=01/10/2004 7:00:00 am
Column N = hours needed ie N8=3.0
P8=01/10/2004 10:00:00 am

This is a schedule which calculates time periods. My formula (p8=P7+N8/24) is inserted via VBA

Range("P" & r).Formula = "=P" & r - 1 & " + N" & r & "/ 24"

for rows 7 thru last row.

How can I update this formula so that a deleted row does not result in references to no longer existent cells and #REF errors?

Totally struggling here and would appreciate any insight whatsoever!
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Sandy Radjenovic

Board Regular
Joined
Nov 4, 2003
Messages
76
You are so wonderful! I have been playing with the offset command for some time and, obviously, never came up with the correct syntax!
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,088
Messages
5,768,034
Members
425,451
Latest member
JohnBrooksBiddle

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
Top