Finding Nearest Upgrade Date

Justinian

Well-known Member
Joined
Aug 9, 2009
Messages
1,557
Office Version
  1. 365
Platform
  1. Windows
I have a list of phone upgrade dates:

11/15/15
10/05/15
6/23/14
10/15/15
12/4/15
7/15/15
8/2/14

I need Excel to look at today's date and highlight the nearest upgrade date. How do I do that?
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Assuming that A2:A8 contains the data, try the following...

1) Select A2:A8

2) On the Ribbon, select Home > Styles > Conditional Formatting > New Rule

3) Under Select a Rule Type, select 'Use a formula to determine which cells to format'

4) Under Edit the Rule Description, enter the following formula:

Code:
=ABS((TODAY()-A2))=MIN(ABS(TODAY()-$A$2:$A$8))

5) Click on Format, select your formatting, and click OK

6) Click OK

Hope this helps!
 
Upvote 0
I just found this formula online but it does not work for me:

=SMALL(IF(($A$2:$A$15>TODAY()),$A$2:$A$15),1)

A2:A15 are my dates.
 
Upvote 0
This uses a helper column B to determine the nearest date, and conditional formatting to highlight the date for minimum value from column B
Excel Workbook
AB
111/15/2015530
210/5/2015489
36/23/201420
410/15/2015499
512/4/2015549
67/15/2015407
78/2/201460
Sheet
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A11. / Formula is =$B1=MIN($B$1:$B$7)Abc
A21. / Formula is =$B2=MIN($B$1:$B$7)Abc
A31. / Formula is =$B3=MIN($B$1:$B$7)Abc
A41. / Formula is =$B4=MIN($B$1:$B$7)Abc
A51. / Formula is =$B5=MIN($B$1:$B$7)Abc
A61. / Formula is =$B6=MIN($B$1:$B$7)Abc
A71. / Formula is =$B7=MIN($B$1:$B$7)Abc
 
Upvote 0
I just found this formula online but it does not work for me:

=SMALL(IF(($A$2:$A$15>TODAY()),$A$2:$A$15),1)

A2:A15 are my dates.

For a formula solution, try the following formula that needs to be confirmed with CONTROL+SHIFT+ENTER...

=INDEX(A2:A8,MATCH(MIN(ABS(TODAY()-A2:A8)),ABS(TODAY()-A2:A8),0))

Adjust the ranges, accordingly.

Hope this helps!
 
Upvote 0
Assuming that A2:A8 contains the data, try the following...

1) Select A2:A8

2) On the Ribbon, select Home > Styles > Conditional Formatting > New Rule

3) Under Select a Rule Type, select 'Use a formula to determine which cells to format'

4) Under Edit the Rule Description, enter the following formula:

Code:
=ABS((TODAY()-A2))=MIN(ABS(TODAY()-$A$2:$A$8))

5) Click on Format, select your formatting, and click OK

6) Click OK

Hope this helps!

That worked but it highlighted 12/14/15 and did not highlight 6/23/14, as I was hoping. I am trying to get a date to appear in cell C17.
 
Upvote 0
For a formula solution, try the following formula that needs to be confirmed with CONTROL+SHIFT+ENTER...

=INDEX(A2:A8,MATCH(MIN(ABS(TODAY()-A2:A8)),ABS(TODAY()-A2:A8),0))

Adjust the ranges, accordingly.



Hope this helps!

When I hit Ctrl + Shift + Enter, I get this: ######################################.
 
Upvote 0
That worked but it highlighted 12/14/15 and did not highlight 6/23/14, as I was hoping.

It should highlight 6/23/14. In fact, I tested it and it does highlight 6/23/14. Make sure that all dates are true date values. You can test whether they're true date values by using ISNUMBER. For example, to test whether A2 is a true date value, the following formula would return TRUE if the value is a true date value...

=ISNUMBER(A2)

I am trying to get a date to appear in cell C17.

Have a look at my last post, which provides you with a formula to return the closest date to today's date.
 
Upvote 0
It should highlight 6/23/14. In fact, I tested it and it does highlight 6/23/14. Make sure that all dates are true date values. You can test whether they're true date values by using ISNUMBER. For example, to test whether A2 is a true date value, the following formula would return TRUE if the value is a true date value...

=ISNUMBER(A2)



Have a look at my last post, which provides you with a formula to return the closest date to today's date.

I tried that but all that returned in C17 is ##########################.
 
Upvote 0
My apologies! I was not making this an array formula.

This works perfectly now. Thank you!!
 
Upvote 0

Forum statistics

Threads
1,220,518
Messages
6,154,410
Members
451,209
Latest member
Julie Petersen

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