Hello,
I am looking for a formula or macro to help me populate blank cells. The situation is that I have minute-by-minute data, but there are some missing minutes. Sometimes a single minute is missing, sometimes a chunk of minutes is missing. I have a macro that inserts a row every time there is a missing minute. Where I am stuck is that I need to fill in data for the missing minutes with the average of the nearest non-blank before and after.
For a single minute of missing data, the formula is very easy. I can just enter =AVERAGE(R[-1]C,R[1]C).
For two minutes of missing data, the first minute will have the formula =AVERAGE(R[-1]C,R[2]C), and the second minute of missing data has the formula =AVERAGE(R[-2]C,R[1]C). (and so on).
I have a TON of missing minutes to populate, and the fact that I can't just make a formula and drag it down across all the missing rows is making this very time consuming. Can you think of a way to write the formula that would automate this? I'm thinking maybe some kind of indirect function but I'm just not sure. I'm open to adding helper columns, anything to speed up the process of populating all these empty rows! Thank you!
I am looking for a formula or macro to help me populate blank cells. The situation is that I have minute-by-minute data, but there are some missing minutes. Sometimes a single minute is missing, sometimes a chunk of minutes is missing. I have a macro that inserts a row every time there is a missing minute. Where I am stuck is that I need to fill in data for the missing minutes with the average of the nearest non-blank before and after.
For a single minute of missing data, the formula is very easy. I can just enter =AVERAGE(R[-1]C,R[1]C).
For two minutes of missing data, the first minute will have the formula =AVERAGE(R[-1]C,R[2]C), and the second minute of missing data has the formula =AVERAGE(R[-2]C,R[1]C). (and so on).
I have a TON of missing minutes to populate, and the fact that I can't just make a formula and drag it down across all the missing rows is making this very time consuming. Can you think of a way to write the formula that would automate this? I'm thinking maybe some kind of indirect function but I'm just not sure. I'm open to adding helper columns, anything to speed up the process of populating all these empty rows! Thank you!