Between dates validation

jl2509

Board Regular
Joined
Oct 30, 2015
Messages
198
Office Version
  1. 365
Platform
  1. Windows
Hi All
Is it possible to have a date validated in a range of dates when it is entered.
i.e. a date is entered "Cell A10" in this case and is validated between dates entered in the range A1:B9 but is continually growing in size

The conflicting dates already entered are highlighted YELLOW and the most recent date is highlighted RED

1710944239567.png
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
If I understand you correctly - you want new dates entered in column A to lie between the dates in the row above? If that's the case, try the following data validation - Allow: Custom;
Formula:
Excel Formula:
=AND(A10>OFFSET(A10,-1,0,1,1),A10<OFFSET(A10,-1,1,1,1),OFFSET(A10,-1,1,1,1)<>"")

I've used A10 as the starting point, but copy this validation to all cells in column A you expect to be using.
 
Upvote 0
Assuming what @kevin9999 assumed, I believe this formula will also work...
Excel Formula:
=MEDIAN(A10,OFFSET(A10,-1,),OFFSET(A10,-1,1))=A10

@kevin9999 - do you really need the last OFFSET in your formula?
 
Upvote 0
In principle you could use the other arguments of Offset although that makes it far less intuitive.
;)
Excel Formula:
=MEDIAN(A10,OFFSET(A10,-1,0,1,2))=A10
 
Upvote 0
Hi All
Thanks for he Reponses

I do actually need the last entry in column A to check against the entire table from row 2 as a check for overlap of dates.
I guess this could also take a different approach, where the last date entered in column A (A10 in this case) must be greater than all of the end date(s) in column B?
 
Upvote 0
In case this has not been explained correctly, the list grows daily and could be 10 rows longer each day. I assume that the last row in the responses is not dynamic and fixed at row A10, whereas it would need to be dynamic if possible?
 
Upvote 0
Would something like this work for you ?

20240321 Date Between Previous dates jl2509.xlsx
ABCD
130/08/202429/09/2024
25/09/20245/10/2024
37/09/20247/10/2024
418/09/202418/10/2024
520/09/202420/10/2024
625/09/202425/10/2024True = No Overlap
79/11/20249/12/2024
818/11/202418/12/2024
913/12/202412/01/2025Col A CheckCol B Check
1022/09/202428/10/2024FALSETRUE
1113/01/202515/01/2025TRUETRUE
1229/10/202420/11/2024TRUEFALSE
Data
Cell Formulas
RangeFormula
C10:D12C10=COUNT(FILTER($A$1:$A9,($A$1:$A9<=A10)*($B$1:$B9)>=A10))=0
Cells with Data Validation
CellAllowCriteria
A10:B12Custom=COUNT(FILTER($A$1:$A9,($A$1:$A9<=A10)*($B$1:$B9)>=A10))=0
 
Upvote 0
Thanks for the update Alex

Unfortunately this does not work
This still using A10 as a reference point? Today the list is at row 150 and tomorrow will be possibly at row 160
I also cannot add any additional columns as suggested in C and D as data already exists there

As soon as a user enters a new date in column A (the next available empty cell in column A) the conditional formatting formula should check to see if the last date entered is greater than all dates in column B, otherwise highlight the last date entered.

It is the last date entered that needs to be a dynamic reference.
 
Upvote 0
Columns C & D were just informational.
Just copy the validation in a10 & b10 down as many rows as you need to eg 1000
 
Upvote 0
Sorry Alex, im lost now.
I am not sure where to add the formula and where is the validation A10 & B10?

Is this formula to be used in conditional formatting or data validation? I am looking for conditional formatting so the dates are highlighted?
 
Upvote 0

Forum statistics

Threads
1,215,094
Messages
6,123,071
Members
449,092
Latest member
ipruravindra

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