Minimum value between dates

Excellling

Board Regular
Joined
Sep 4, 2013
Messages
92
Hi All

I have been looking around quite a bit to find a formula for my specific purpose in relation to returning a minimum value between dates.

Basically I would like a formula to return the Pay # when today() date is equal to or less than the pay date (but the next pay date has not happened yet).

For example, If Today() is 2/3/2023 then return 18, and return 18 everyday until today() becomes 16/3/2023 and then start returning 19.

So far I have tried MINIFS, Min with multiple criteria and tried to combine MAX and MIN - not having too much luck. I also tried offset function to try to look at the next row in the Pay Dates column to work out whether the next pay date is current or not.

Hoping this makes sense

I have attached a little spreadsheet to assist and appreciate any advice - thank you
 

Attachments

  • Excel.PNG
    Excel.PNG
    15.8 KB · Views: 49

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Thank you kindly Tetra201

This works perfectly.

Just for my learning purposes, what exactly does the Lookup function do? By what I just looked up (after you sent your assistance) it brings back a corresponding value in a column to the right, but when the date moves to 3/3/2023 it is doing what I want and still returning 18 but I don't really understand why.

Regards
 
Upvote 0
From the LOOKUP function help:
  • If the LOOKUP function can't find the lookup_value, the function matches the largest value in lookup_vector that is less than or equal to lookup_value
So, if 3/3/2023 cannot be found, the function matches 2/3/2023 and returns 18.
 
Upvote 0
@Excellling
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’)

If you have a recent version with XLOOKUP then you could also investigate that as it has a number of features that may benefit you in other circumstances. For this task it would be

Excel Formula:
=XLOOKUP(A2,B2:B27,C2:C27,,-1)
 
Upvote 0

Forum statistics

Threads
1,223,708
Messages
6,174,006
Members
452,542
Latest member
Bricklin

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