Find the value based on date

pyclen

Board Regular
Joined
Jan 17, 2022
Messages
85
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi All,

I have the below table from the Bureau of Labor Statistics (Bureau of Labor Statistics Data) showing the pricing index for a given month.

1663934688733.png


To calculate the increase from one month to another (same or different year) I am using this table with the change being calculated using
Excel Formula:
=ROUND(((D8-D7)/D7)*100,1)
DateValue
Initial Index ValueMay-20179.9 (this is D7 in above formula)
Current Index ValueMar-22281.396 (this is D8 in above formula)
% Change56.4

As of now I am changing the months manually as well as finding the corresponding value for the month for this calculation.
How can I get it to work

1. more automatically, i.e., I select the corresponding months and XL will populate the corresponding values in the last column
2. be dynamic, as every month new data gets published (I have the above table linked to the web source, so once a month I refresh the data for this table)

Any help is highly appreciated
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
What you need can be done dynamically using SUMPRODUCT or INDEX-MATCH Formula.

The only hindrance here is that you haven't uploaded sample data using XL2BB to help you populate formula.
 
Upvote 0
Hi Sanjay,

thank you for your reply however there is no other data to provide and I don;t think it is necessary to use the xl2bb tool for this.
I literally just want to pick a month in both cells (like May2020 and Mar2022) and XL finds the corresponding values in the table that match these months (here 179.9 & 281.396)
The %change is then calculated using the shown formula.
 
Upvote 0
You may be right in your own way, but to populate and test formula need to have some data in hand. Anyone who is willing to help you have to go through tedious process to recreate the whole data. You can save them the effort just by posting data through XL2BB.

Hope this clarifies the need.
 
Upvote 0
Book1
ABCDEFGHIJKLMNOPQRS
2
3YearJanFebMarAprMayJunJulAugSepOctNovDecDateValue
42012169.4169.4169.4169169.7169.5172.7173.7173.4173.9173.7173.8Initial Index valueDec-18263.2
52013179.9181181.5181.6182.5183.4185.9185.7181.7182.1182.1184Current Index ValueDec-19268.1
62014192.8193.2192.8192.3193.2195.4197.3197.7197.6199.2199.2201.6% Change1.9
72015207.8207.9208207.7208.5216.0216.1216.1216.2216.2216.1217.2
82016227.8228.6228.6228.9229.0232.0232.5233.5233.7234.4234.4234.7
92017243.7243.7243.7243.7244.7247.1247.4247.5245.5250.3250.2250.5
102018257.8257.8257.8257.5257.2257.9260.3259.1259.4260.5262.3263.2
112019267.9267.9268.6269268.5268.2268.3268.4268.4268.5268.4268.1
122020273.3274.3274.6274.6274.5274.5274.8274.6272.8272.8272.8272.9
132021277277.4278.1277.6277.6277.6276.178276.244276.365276.538276.583276.518
142022280.03281.186281.396281.303281.327(P)281.335(P)282.669(P)282.839(P)
Table 1
Cell Formulas
RangeFormula
R4:R5R4=M10
R6R6=ROUND(((R5-R4)/R4)*100,1)
 
Upvote 0
Check this - See R4, R5, also change in B3:M3

All Records.xlsb
ABCDEFGHIJKLMNOPQR
1
2
3YearJanFebMarAprMayJunJulAugSepOctNovDecDateValue
42012169.4169.4169.4169169.7169.5172.7173.7173.4173.9173.7173.8Initial Index value43,435263.20
52013179.9181181.5181.6182.5183.4185.9185.7181.7182.1182.1184Current Index Value43,800268.10
62014192.8193.2192.8192.3193.2195.4197.3197.7197.6199.2199.2201.6% Change1.90
72015207.8207.9208207.7208.5216216.1216.1216.2216.2216.1217.2
82016227.8228.6228.6228.9229232232.5233.5233.7234.4234.4234.7
92017243.7243.7243.7243.7244.7247.1247.4247.5245.5250.3250.2250.5
102018257.8257.8257.8257.5257.2257.9260.3259.1259.4260.5262.3263.2
112019267.9267.9268.6269268.5268.2268.3268.4268.4268.5268.4268.1
122020273.3274.3274.6274.6274.5274.5274.8274.6272.8272.8272.8272.9
132021277277.4278.1277.6277.6277.6276.178276.244276.365276.538276.583276.518
142022280.03281.186281.396281.303281.327(P)281.335(P)282.669(P)282.839(P)
Sheet4
Cell Formulas
RangeFormula
R4:R5R4=INDEX($A$3:$M$14,MATCH(YEAR(Q4),$A$3:$A$14,0),MATCH(MONTH(Q4),MONTH($A$3:$M$3),0))
R6R6=ROUND(((R5-R4)/R4)*100,1)
 
Upvote 0
Thanks Sanjay for the help, and I see that it works for your version of Office

Since I do need this for work, and I am stuck w/XL2019, not 365, I am getting a #value error. I am not sure what is the problem as XL2019 seems to know month/year formula and should know index and match.
I tried modifying the date to numbers, changing the date (I had mmm-yyyy specified, now it is mmm yyyy), the error comes at the last match (bold) =INDEX($A$3:$M$14,MATCH(YEAR(Q4),$A$3:$A$14,0),MATCH(MONTH(Q4),MONTH($A$3:$M$3),0))

Did you change the data type to something, I tried date, text, even made a completely new row for month below the table and adjusted the reference, still #value, not sure what is wrong
 
Upvote 0
#value erro
Value error could be because you didn't change the Month Values from B3:M3

Just put 1 Jan, 1 Feb dates in those cells and Format them as "MMM"

Excel Version is not a challenge at all

Please check and update.
 
Upvote 0
I have everything formatted as you said, same result
maybe attach the XL file you have so I can compare what is wrong w/my file or where I fail to format correctly

B3:m3 all is formatted as MMM
 
Upvote 0

Forum statistics

Threads
1,216,750
Messages
6,132,500
Members
449,730
Latest member
SeanHT

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