Dynamic cell reference - VLOOKUP

Calum

New Member
Joined
Aug 13, 2015
Messages
24
Hello,

I need to populate cell values for blank month entries by taking the average of the two months that fall either side of the blank entry.

The troubling part is that there may be one or more blank entries lumped together for one or more successive months. My attempt at tackling this was to use =AVERAGE and identify the last non-blank entry for the range of rows above each missing row, and the first non-blank entry for the rows below each missing row.

My attempts to find the last non-blank entry above the row have been along the lines of:

=LOOKUP(2,1/("C2:"&"C"&ROW()<>""), ("C2:"&"C"&ROW()))
https://exceljet.net/formula/get-val...non-empty-cell

The concatenated string that is used for the referencing does not read into the lookup as a cell reference however :(

Any help appreciated!
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
In this case it would be useful to see sample data with expected results.
 
Upvote 0
Hi steve,

Apologies for the delay but I worked it out in the end. I used the strategy as I had listeed before and defined some helper columns which were then referenced using INDIRECT().

Thanks!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

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