Data validation with date function fails

Jazz Engineer

New Member
Joined
Feb 1, 2022
Messages
15
Office Version
  1. 365
Platform
  1. Windows
I have a column that is supposed to have dates entered, and is formatted for short date. The condition is: any date entered must have occurred in this year or a later year. I have entered the XL2BB code below and a screen shot afterwards. The problem is that dates in previous years are accepted without any error messages.

e04Marathons_CarmeliSteve.xlsm
A
53/4/2020
Expenses
Cells with Data Validation
CellAllowCriteria
A5Date>=YEAR(TODAY())
B5List=Marathon_Name
A6:A40Date<TODAY()
B6:B12ListMarathons
B13:B40List=Marathons


1663203015600.png


Thanks for your help,

Steve
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
rlv01

That's not a bad solution, but it's not perfect. Suppose I want to convert my workbook to a template? This would enable users to enter event data from 2022 in 2023.

Also, something doesn't make sense to me: I can't imagine a program as sophisticated as Excel not supporting nested functions anywhere. I fear that I've played around with a setting in Options that would explain why this isn't working. In support of this hunch, YSKT this worked for a while. While the top cell in the range wouldn't trigger an error, subsequent cells below would.
 
Upvote 0
You're testing: >=YEAR(TODAY())

Which means >=2022, i.e. >=14 July 1905.

Instead, try: >=DATE(YEAR(TODAY(),1,1)
 
Upvote 0
You're testing: >=YEAR(TODAY())

Which means >=2022, i.e. >=14 July 1905.

Instead, try: >=DATE(YEAR(TODAY(),1,1)
When I tried your suggestion, I received this error message:

1663622339973.png


Did you test your idea before responding to me? I still fear that I have a setting somewhere in options that is affecting this matter. Thanks anyway!
 
Upvote 0
Or try

=YEAR(A5)>=YEAR(TODAY())
This one produced interesting results. I entered your suggestion as evidenced by the screen capture below:

1663623001865.png


But I also copied the formula into cell A8. It would return FALSE/TRUE depending on the date entered in A5. This is what happened when I entered the date 7/14/21 (Yes, the cells are formatted as Date). Also, the value in A8 was FALSE.


1663623133074.png



However, when I entered a date that should've passed muster, this is what happened:

1663623390911.png


The date is valid for the restriction, the error message says it isn't valid, but the formula in A8 says it is.

Any ideas on what's happening?

Steve
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,141
Members
453,021
Latest member
Justyna P

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