Prioritising Dates

IanDouglas

New Member
Joined
Jun 1, 2017
Messages
2
Hello all,

I have a lot of data with three input columns (End date, Break Date, Rent review) and I can't work out a formula for the output column (LEASE EVENT).

In each row, i want to know the closest date FROM today date, with the corresponding column heading to end up in the output column. A mannual example below

End date (to)BreakDateRent ReviewLEASE EVENT
30/06/202501/07/202001/07/2015Break Date
30/06/2026n/a01/07/2016End Date
24/02/201825/03/201325/07/2017Rent Review
03/11/201904/11/201504/11/2015 ??

<colgroup><col span="4"></colgroup><tbody>
</tbody>

I need help building a formula for this.

Kind regards,

Ian

<colgroup><col><col><col span="2"></colgroup><tbody>
</tbody>
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Welcome to the forum.

I think you meant to say that you want the next closest data to today's date. Your sample data includes dates that are closer to today but have already passed.

This works, but it is admittedly bulky. Copy D2 down as necessary.

ABCD
1End date (to)BreakDateRent ReviewLEASE EVENT
26/30/20257/1/20207/1/2015BreakDate
36/30/20267/1/2016End date (to)
42/24/20183/25/20137/25/2017Rent Review
511/3/201911/4/201511/4/2015End date (to)

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet27

Array Formulas
CellFormula
D2{=INDEX($A$1:$C$1,,MAX((MIN(IF((A2:C2-TODAY())>0,(A2:C2-TODAY()),10^30))=(A2:C2-TODAY()))*(COLUMN(A2:C2)-COLUMN(A2)+1)))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try to enter the {} manually yourself.

<tbody>
</tbody>
 
Upvote 0
Welcome to the forum.

I think you meant to say that you want the next closest data to today's date. Your sample data includes dates that are closer to today but have already passed.

This works, but it is admittedly bulky. Copy D2 down as necessary.

ABCD
1End date (to)BreakDateRent ReviewLEASE EVENT
26/30/20257/1/20207/1/2015BreakDate
36/30/20267/1/2016End date (to)
42/24/20183/25/20137/25/2017Rent Review
511/3/201911/4/201511/4/2015End date (to)

<tbody>
</tbody>
Sheet27

Array Formulas
CellFormula
D2{=INDEX($A$1:$C$1,,MAX((MIN(IF((A2:C2-TODAY())>0,(A2:C2-TODAY()),10^30))=(A2:C2-TODAY()))*(COLUMN(A2:C2)-COLUMN(A2)+1)))}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try to enter the {} manually yourself.

<tbody>
</tbody>
[

Worked like a charm! Thankyou very much for our help DrSteele]
 
Upvote 0

Forum statistics

Threads
1,215,490
Messages
6,125,096
Members
449,205
Latest member
ralemanygarcia

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