Pick up applicable rate

th081

Board Regular
Joined
Mar 26, 2006
Messages
98
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I have two sheets in my spreadsheet, one contains dates, codes and product rates as below:

DateProduct CodePrice
01/04/2011​
BADE23
26/07/2011​
BADE23.7
01/04/2012​
BADE24
01/04/2013​
BADE24
01/04/2014​
BADE28
01/04/2015​
BADE29
01/04/2016​
BADE27
01/04/2017​
BADE30
01/04/2018​
BADE33
01/04/2019​
BADE35
01/04/2020​
BADE36
01/10/2021​
BADE36.8
01/04/2021​
BADE36.9
01/04/2009​
CDGE15
01/04/2021​
CDGE15.1
01/04/2015​
EYUT120
01/04/2016​
EYUT125
01/04/2017​
EYUT130
01/04/2018​
EYUT131
01/04/2019​
EYUT130
01/09/2020​
EYUT135
01/04/2021​
EYUT142


In a separate sheet i have dates for a whole year i.e 01/01/2011 to 31/12/2011, how do i lookup and get the rate that was applicable on a particular date? A rate is applicable up to the date a new rate goes live so the product BADE would have the rate 23 from 01/04/11 to 25/06/11 of 23 and then from 26/07/11 the rate will be 23.7 until 31/03/12

Regards

TH081
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Thanks for that, how about
+Fluff 1.xlsm
ABCDEFGHI
1DateProduct CodePrice
201/04/2011BADE2327/08/2011Bade23.7
326/07/2011BADE23.701/03/2020eyut130
401/04/2012BADE24
501/04/2013BADE24
601/04/2014BADE28
701/04/2015BADE29
801/04/2016BADE27
901/04/2017BADE30
1001/04/2018BADE33
1101/04/2019BADE35
1201/04/2020BADE36
1301/10/2021BADE36.8
1401/04/2021BADE36.9
1501/04/2009CDGE15
1601/04/2021CDGE15.1
1701/04/2015EYUT120
1801/04/2016EYUT125
1901/04/2017EYUT130
2001/04/2018EYUT131
2101/04/2019EYUT130
2201/09/2020EYUT135
2301/04/2021EYUT142
24
Master
Cell Formulas
RangeFormula
I2:I3I2=INDEX(SORT(FILTER($A$2:$C$23,($B$2:$B$23=H2)*($A$2:$A$23<=G2)),1,-1),1,3)
 
Upvote 0
Thank you, unfortunately the SORT function does not appear to be available to me. It is a Office Office 365 ProPlus version but a corporate version and it says updates are controlled by the administrator so the SORT update has probably not been pushed through yet.
 
Upvote 0
Ok, how about
Excel Formula:
=INDEX($C$2:$C$23,AGGREGATE(14,6,(ROW($C$2:$C$23)-ROW($C$2)+1)/($B$2:$B$23=H2)/($A$2:$A$23<=G2),1))
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0
Ok, how about
Excel Formula:
=INDEX($C$2:$C$23,AGGREGATE(14,6,(ROW($C$2:$C$23)-ROW($C$2)+1)/($B$2:$B$23=H2)/($A$2:$A$23<=G2),1))

I believe this would need the Date to be ascending (at least within Product Code).
e.g. A BADE entry for 1 November 2021 will retrieve the row 14 for 1 April 2021 value of 36.9 instead of the row 13 for 1 October 2021 value of 36.8.
 
Upvote 0
You're quite right, I hadn't noticed that there was one date out of order.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,751
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