Replace Blanks with Formula with Relative References

DaveWW00

New Member
Joined
Feb 3, 2006
Messages
40
So have large spreadsheet with grid of elevations. Each column/row is 1 foot grid. There are blanks in it where there was no elevation data available. I need to interpolate those elevations using the surrounding known elevations. I can setup the interpolation just fine using a circular reference but what i am having trouble with is getting formula into all the cells. I need to replace blanks with formula that averages all four cells around it. This will result in circular references that will interpolate from known points nearby. So for example if cell D4 was blank formula needs to be =(D3+E4+D5+C4)/4. D5 would be =(D4+E5+D6+C5)/4. I have been playing around trying to make a macro or something to do this but am not having any luck. Can somebody please help me out with this? Basically need to find/replace all blanks with formula above but so the formula references the cells around it properly. Thanks!
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Try this

Do Not press ENTER on any of these steps until the end..

Highight the entire range
Press CTRL + G
Selct Goto - Special - Blanks OK
Type =(
Press Left Arrow
Press +
Press UP Arrow
Press +
Press Right Arrow
Press +
Press Down Arrow
Type )/4
Press CTRL + ENTER
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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