Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations pierreick on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel code or macro to interpolate between data points

Status
Not open for further replies.

stadamack

Mechanical
Nov 3, 2009
12

Electricity meter readings are recorded every 7 days and recorded in an excel spreadsheet. Date is recorded in Col 1. Corresponding meter reading is recorded in Col 2. From the data entered I would like to automatically calculate the consumption for each month. The code / macro should interpolate to determine meter readings at the beginning and end of each month - these can then be subtracted to determine consumption during any month.
 
Replies continue below

Recommended for you

Electricity meter readings are recorded every 7 days and recorded in an excel spreadsheet. Date is recorded in Col 1. Corresponding meter reading is recorded in Col 2. From the data entered I would like to automatically calculate the consumption for each month. The code / macro should interpolate to determine meter readings at the beginning and end of each month - these can then be subtracted to determine consumption during any month.
 
 http://files.engineering.com/getfile.aspx?folder=1ea07915-637d-4f60-a1fd-906ceccee201&file=2009.11.03_Energy.xls
Wny not use Excel's regression tools?

TTFN

FAQ731-376
 
maybe there is a function in the regression tools to do this? have examined the trend function but this fits a line using least squares rather than linear interpolation.
 
linear interpolation only requires two points, so what's the problem?

TTFN

FAQ731-376
 
linear interpolation is no problem. am trying to set up a spreadsheet to automate the process. data is input in 2 columns. Col 1 date. Col 2 meter readings. Is there a function that can take the following inputs:
- a value in the range in Col 1
- an array containing Col 1 + Col 2
and return a corresponding value from col 2.
A function that conducts linear interpolation as required.
 
This question is more appropriate to Tek-tips.com and their Excel forums.

Dan - Owner
Footwell%20Animation%20Tiny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor