Force cell entry strictly to mm/dd/yyyy

odonnell

New Member
Joined
Mar 11, 2015
Messages
12
Using Excel 2007, and I want to force entry to calls in a date column to the format mm/dd/yyyy. Currently I have the cells formatted for mm/dd/yyyy and entered data validation date range between 12/31/1999 and 12/31/2060. However some users are too lazy to look up the day case start and just enter 05/03 (mm/yy) and data validation allows this, then excel formats the date as 05/03/2015.</SPAN>
I don’t want to use a macro as macros will be disabled by default and they wont enable it.
I tried to make data validation = text length 10 however it has issues with the ‘/’</SPAN>
Is it possible to make the data validation mm/dd/yyyy and strictly not accept anything else?</SPAN>
thanks guys</SPAN>
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
in an adjacent cell

=if(len(A1)<10,"oops you seem to have entered the date to the wrong format","")
 
Upvote 0
Without VBA, it's not going to be easy.

Basically what happens is the 05/03 is converted to the date 05/01/2015 before data validation even looks at it.
This is why the Len=10 rule doesn't work.
Because the real value of a date is a serial number, incrimenting by 1 since Jan 1 1900.
So 3/11/2015 = 42074
LEN(42074) = 5

The only solution I can imagine (without VBA) is to format the entry cells as TEXT.
Then you can use the LEN = 10 rule.

Side effect is that any formulas that refer to them will no longer consider them dates, they'll be text strings..
You'd have to have a helper column to do =A1+0 to convert them to dates for your other formulas to refer to.


But even this is still not fool-proof.
It will not tell the difference between a date entered as mm/dd/yyyy and a date entered as dd/mm/yyyy
 
Last edited:
Upvote 0
Or create 3 cells with data validation "lists" 1 for days, 1 for months, 1 for years, then use =date(c1,b1,a1)
 
Upvote 0
0726157/26/15150101
160202
170303
180404
190505
200606
0707
0808
0909
1010
1111
1212
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

<colgroup><col><col span="16"></colgroup><tbody>
</tbody>
 
Upvote 0
Maybe long winded but set the lists by month!
Someone is bound to enter 31/2/2015
Which would return 3/3/2015 (I think)
 
Upvote 0
Thanks guys, some good ways I never thought about. Will test all out and see what works.
Cant beleive i didnt think about the list option! doh!
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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