Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Deleting lines that use them for formulas

I have the follwoing table:
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="")),"tota l",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.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default Deleting lines that use them for formulas

=IF(AND(A3="",ADDRESS(ROW()-1,1)=""),"",IF(AND(A3="",NOT(ADDRESS(ROW()-1,1)="")),"total",B3*C3))

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"OX_Gambit" wrote:

I have the follwoing table:
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="")),"tota l",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.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Deleting lines that use them for formulas

Luke,

Thank you for the help. It fixed my initial question, but when I drag the
formula down past the bottom the original "total" the cells are filled with
the word "total". I would only like the top most cell with nothing in column
A to be filled with the word "total"

It seems that ADDRESS(ROW()-1,1)=0 is not true in your formula therefore not
putting "" in the cell.

Thank you for any help that you can provide.
"Luke M" wrote:

=IF(AND(A3="",ADDRESS(ROW()-1,1)=""),"",IF(AND(A3="",NOT(ADDRESS(ROW()-1,1)="")),"total",B3*C3))

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"OX_Gambit" wrote:

I have the follwoing table:
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="")),"tota l",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.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 348
Default Deleting lines that use them for formulas

OX_Gambit wrote:
I have the follwoing table:
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="")),"tota l",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.

Why not just hide row 2?

Bill
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Deleting lines that use them for formulas

That is not the complete sheet. In the cell next to "total" I will have the
sum of column D, so hiding the row will include that row in the sum and that
will give an incorrect total.

"Bill Sharpe" wrote:

OX_Gambit wrote:
I have the follwoing table:
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="")),"tota l",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.

Why not just hide row 2?

Bill

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting Lines or Copying lines with formulas but without data wnfisba Excel Discussion (Misc queries) 2 August 18th 06 04:41 PM
Deleting unused lines between used lines? Stevel Setting up and Configuration of Excel 1 November 25th 05 12:58 AM
Deleting Lines in Excel sibadee14 Excel Discussion (Misc queries) 1 November 16th 05 06:56 AM
deleting values in a worksheet without deleting the formulas patti Excel Worksheet Functions 1 October 28th 05 09:49 PM
Deleting multiple lines tammytlc Excel Discussion (Misc queries) 1 October 3rd 05 11:49 PM


All times are GMT +1. The time now is 11:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"