Help finding value associated with date closest to (or prior to) today

dgarciasl

New Member
Joined
Apr 9, 2021
Messages
1
Office Version
  1. 365
Platform
  1. MacOS
I have an excel table, containing dates in column a value in column K. I need a formula that identifies the K value associated with the today's date. if there is no value for today, it should show the value of the closest date prior today.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
=IFERROR(INDEX($A$1:$A$100,MATCH(TODAY(),$A$1:$A$100,0)),IFERROR(INDEX($A$1:$A$100,MATCH(TODAY(),$A$1:$A$100,1)),INDEX($A$1:$A$100,MATCH(TODAY(),$A$1:$A$100,-1))))
 
Upvote 0
If I have understood your requirement correctly then ...

If the dates are sorted oldest to nest, try

21 04 10.xlsm
AKLM
1DateValue
21/03/2021767
35/03/202176
47/03/202183
513/03/202144
631/03/202154
74/04/202167
822/04/202196
928/04/202175
1030/04/20219
Closest Date
Cell Formulas
RangeFormula
M2M2=VLOOKUP(TODAY(),A2:K10,11)



If the dates are not sorted, try

21 04 10.xlsm
AKLM
1DateValue
21/03/2021767
330/04/20219
47/03/202183
513/03/202144
64/04/202167
722/04/202196
831/03/202154
95/03/202176
1028/04/202175
Closest Date (2)
Cell Formulas
RangeFormula
M2M2=INDEX(K2:K10,MATCH(AGGREGATE(14,6,A2:A10/(A2:A10<=TODAY()),1),A2:A10,0))
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,255
Members
449,075
Latest member
staticfluids

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