O

#### OX_Gambit

Item qty Price Total Price

1 2 45 90

2 4 6 24

3 7 78 546

4 8 34 272

5 3 23 69

total

In column D I have the following formula

=IF(AND(X="",Y=""),"",IF(AND(X="",NOT(Y="")),"total",W*Z))

X = 3 columns to the left

Y = 3 columns to the left and one row up

W = 2 columns to the left

Z = 1 columns to the left

So in the cell that contains 24 (D3) I have the following formula

=IF(AND(A3="",A2=""),"",IF(AND(A3="",NOT(A2="")),"total",B3*C3))

If I delete Row 2 I get a reference error in the new D2. Is there any way

to change the formula so that if I delete a row that a cell below it

references to have the formula refence the new row above it?

So after deleting row 2 I want the cell that should now have 24 in it New D2

(old D3) to be:

=IF(AND(A2="",A1=""),"",IF(AND(A2="",NOT(A1="")),"total",B2*C2))

Thank you for any help you can provide.