Interpolation and Extrapolation in Excel

Interpolation and Extrapolation in Excel

This trick will save you time to do interpolation and extrapolation out from a table in Excel. It is powered by VBA or Macro using a user-defined function.

Description of Example

We have a table of thermal expansion of carbon steel at different change in temperature. The objective is to find the value of expansion at 35 degrees Celsius in reference to the given table.
Stacks Image 259

The screen recording below shows how to use the user-defined function 'InterpolateTable()'.
Stacks Image 140

Creating the User-Defined Function

Step 1. Go to 'Developer' menu, then choose 'Visual Basic'
See below figure.
Stacks Image 263

Step 2. Right-click from the left side panel of the new window, then choose 'Insert' > 'Module'.
See below figure.
Stacks Image 267

Step 3. Copy and paste the following VBA code to the new module that has been created. Your screen must be similar to this screenshot.
Stacks Image 176

Step 4. Close the VBA window and use the newly created function by typing =InterpolateTable(). See below figure and screen recording.
Stacks Image 235
Stacks Image 241
Download the example Excel file using the button below.
Show Comments

About Us

Excelcrib was founded in November 2017 by Garry, a Microsoft® Office Excel® (MS Excel) enthusiast with background in engineering. He's been using MS Excel for more than 15 years in practice with specialty in VBA.

© Copyright 2023 Excelcrib | Privacy Policy

We use cookies to improve your browsing experience.
Continuing to use this site means you agree to our use of cookies.
Tell me more!