Cell Reference changes

dave8

Active Member
Joined
Jul 8, 2007
Messages
275
I have a worksheet (Sheet1) with data in the first column....sixth column. In sheet2, each cell of the first column...sixth column points to the corresponding data in Sheet1.

The formula in sheet2 looks like this:

=IF(sheet1!A1="","",sheet1A1)

Here's the problem: If I delete the first row in Sheet1, the formula in Sheet2 will have an error: =IF(sheet1!#REF!="","",sheet1#REF!)


How to correct this so that if I delete the row(s) in Sheet1, the references in Sheet2 will still point to the corresponding data in Sheet1?
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Thank you but thats not what I meant. I want to be able to keep the formula so that when the row in Sheet1 gets deleted, Sheet2 will point to the same row.
 
Upvote 0
I'm getting an error with this formula:


=IF(sheet1!A1="","",INDIRECT("'"sheet1'!A1") <----- Excel formula error

I also tried:

=IF(sheet1!A1="","",INDIRECT(sheet1!A1) <------ #REF error
 
Upvote 0
Hi Dave,
1) Does your formula =IF(Sheet1!A1="","",Sheet1!A1) the same as =Sheet1!A1 ?
2) To fix the reference use the formula in the same row of Sheet2:
=INDEX(Sheet1!A:A,ROW())
It's not volatile therefore it saves the calculation time.
Regards
 
Last edited:
Upvote 0
I have no formula in Sheet1. The formula is in Sheet2 which points to the data in Sheet1.

I just tried entering your formula in Sheet2: =INDEX(Sheet1!A:A,ROW())

I get a #VALUE! error
 
Upvote 0
Ok, let’s assume that values of Sheet1!A1:B3 are as follows:
Excel Workbook
AB
1110
2220
3330
4
Sheet1


Then in Sheet2!A1:B3 we have result of your formula but with using of INDEX:
Excel Workbook
AB
1110
2220
3330
4  
Sheet2


========
After deleting of the 1st row in Sheet1

Excel Workbook
AB
1220
2330
3
Sheet1


Excel Workbook
AB
1220
2330
3  
4  
Sheet2


HTH
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,693
Members
448,979
Latest member
DET4492

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