Formula problem

22strider

Active Member
Joined
Jun 11, 2007
Messages
311
Hello Friends

I have prepared a template, in one of the sheets (say sheet1) in template there are some formulae that are referencing some cells in other sheet (say sheet2) in the same file.
I am facing this strange problem that when records are removed from the source sheet (sheet2), the formula in the sheet1 changes. Following is exactly what is happening:

The formula in Sheet1 is ='All-HPN-With-Tools'!I2 (so the cell in Sheet1 is referencing value in cell 'I2' in the sheet 'All-HPN-With-Tools')
The problem is that everytime I delete row 2 in the sheet 'All-HPN-With-Tools', the formula in Sheet1 becomes
='All-HPN-With-Tools'!#REF!

I cannot figure out why I2 in the formula gets replaced by #REF! ?

I hope someone will be able to help me out here.

Thanks for your time
Rajesh
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi Rajesh
When you delete the row in sheet 'All-HPN-With-Tools', you delete the cell reference.
Try this:
=INDIRECT("'All-HPN-With-Tools'!I2")

Vidar
 
Upvote 0
Hello Friends

I have prepared a template, in one of the sheets (say sheet1) in template there are some formulae that are referencing some cells in other sheet (say sheet2) in the same file.
I am facing this strange problem that when records are removed from the source sheet (sheet2), the formula in the sheet1 changes. Following is exactly what is happening:

The formula in Sheet1 is ='All-HPN-With-Tools'!I2 (so the cell in Sheet1 is referencing value in cell 'I2' in the sheet 'All-HPN-With-Tools')
The problem is that everytime I delete row 2 in the sheet 'All-HPN-With-Tools', the formula in Sheet1 becomes
='All-HPN-With-Tools'!#REF!

I cannot figure out why I2 in the formula gets replaced by #REF! ?

I hope someone will be able to help me out here.

Thanks for your time
Rajesh

You get a #REF! error because the deletion renders the reference in:

='All-HPN-With-Tools'!I2

invalid.

If you want to fix the reference to I2 at all times, try something like...

Either:

=INDIRECT("'All-HPN-With-Tools'!I2")

Or:

=INDEX('All-HPN-With-Tools'!I:I,2)
 
Upvote 0
I tried INDIRECT after your suggestion; it appears that the formula with INDIRECT function does not refere to next cell when copied. I have VBA code that copies the row with formula and should refer to the next row(s) when copied down. Any suggestion?
 
Upvote 0
I am having same problem using INDEX as well. Can't copy; the copied formula keep referencing to fixed cell address.
 
Upvote 0
I tried INDIRECT after your suggestion; it appears that the formula with INDIRECT function does not refere to next cell when copied. I have VBA code that copies the row with formula and should refer to the next row(s) when copied down. Any suggestion?

Either:

=INDIRECT("'All-HPN-With-Tools'!"&CELL("address",I2))

Or:

Let A2 house the first instance of the formula:

=INDEX('All-HPN-With-Tools'!I:I,ROWS($A$2:A2)+1)

However, why do you delete rows in the input sheet?
 
Upvote 0
I am deleting the rows because the Template will be shared by a large group and they will be replacing input sheet(s). In that process they may simply replace data with new or delete the current data and then paste new input data.
 
Upvote 0
Thanks Aladin and Vidar for your help;

=INDIRECT("'All-HPN-With-Tools'!"&CELL("address",I2)) does what I need to do.

Thanks again
Rajesh
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,964
Members
452,371
Latest member
Frana

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