How to find the closest date after

slgalvan

New Member
Joined
Mar 2, 2022
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Regarding the following question and answer from a previous thread:

Question: I have 2 columns, one has couple dates such as 2/15/2006, 5/10/2006, 5/15/2006, 5/20/2006, 8/15/2006, and 10/15/2006, the other one has a value of 6/15/2006. I want to find the closest date before 6/15/2006. Could you please help me out with this problem?

"iliace" responded:

If the column of dates is always in ascending order (later dates at the bottom), you can use the MATCH() function. Let's say 6/15/2006 is in A1, and the other dates are in B1:B10.

=INDEX($B$1:$B$10, MATCH(A1, $B$1:$B$10, 1))

Will return the closest date before the date in A1.

My Question: How do I get the closest date after the date in A1?
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Your formula will return the closest date before or on the date in A1, provided the dates in B1:B10 are sorted in ascending order.
If you sort the dates in B1:B10 in descending order, you can use the formula below to return the closest date after or on the date in A1.
Book2.xlsm
ABCD
13/7/20223/11/20223/8/2022
23/8/2022
33/6/2022
43/5/2022
53/5/2022
62/28/2022
72/24/2022
82/23/2022
92/22/2022
102/22/2022
List
Cell Formulas
RangeFormula
D1D1=INDEX($B$1:$B$10,MATCH(A1,$B$1:$B$10,-1))
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

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