Formula that calculates using Inflation factors

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,340
Office Version
  1. 365
Platform
  1. Windows
I have a commodity code in column A. then in Columns B through M I have inflation factors for each year starting in 2016 (B has an inflation factor of 2.177%, C 2017=3.419%, D 2018=.03360, E 2019=.02415, F 2020=.02701, G 2021=.0241,H 2022=.02860 and so on (Row 1 has the year Row two has the factor and A2 is where the commodity code is

(On my sheet I have commodity codes going down column A and the Factors going down the other columns as well)

On a separate sheet I have a field where I enter a commodity code in A1 Then A2 I Enter the starting year and A3 the End Year

What I need the formula to do is to look on sheet2 find the matching commodity code. Then depending on the start end year, I year it to figure out the total inflation

So if my start year was 2017 and my end year was 2019 Then it should use the 2018 and 2019 rates and result in 1.05856
=(1+(1*3.360))*(1+2.415)

I know you can do a Sumproduct but that means manually changing the formula because my start and end years change. I need something dynamic. for example someone could enter a start date of 2016 and end date of 2022
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
this solution make use of helpers in Row 5


Book1
ABCDEFGH
12016201720182019202020212022
2Code 12.177%3.419%3.360%2.415%2.701%2.410%2.860%
3
4
5111.03361.02415111
6
7Code 1201720191.058561
Sheet4
Cell Formulas
RangeFormula
B5=IF(AND(B1>$B$7,B1<=$C$7),1+B2,1)
D7=PRODUCT(B5:H5)
 
Upvote 0
Data in Sheet1

ABCDEFGH
12016201720182019202020212022
2Code 12.177%3.419%3.360%2.415%2.701%2.410%2.860%

<tbody>
</tbody>

Sheet2
A1=Code1
A2=2017
A3=2019
ARRAY Formula in A4

=PRODUCT((1+SUMIF(OFFSET(INDEX(Sheet1!$B$2:$H$3,MATCH($A$1,Sheet1!$A$2:$A$3,0),MATCH($A$2+1,Sheet1!$B$1:$H$1,0)),0,ROW(INDIRECT($A$2&":"&$A$3-1))-$A$2),">0")))

How ARRAY formula is entered


Paste Formula in the cell.
Press F2
Hold Shift+ Ctrl Keys and hit Enter key.
Now the formula is surrounded by {} by excel.
 
Last edited:
Upvote 0
In post# 3 Data is only in Row2. In Formula I have added Row 3 also.
In Row 3 You can add data for Code2.
If more rows required,
Then Row 4 for Code3.
So on..
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,748
Members
448,989
Latest member
mariah3

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