Force data entry in nn/nn/nn format when not a date

mrcann

New Member
Joined
Mar 6, 2011
Messages
11
I have some text fields in which I want to enter numbers in the format nn/nn/nn (e.g. 65/45/12). Some of these numbers look a lot like dates.

I want to validate the data entry into these cells in the format nn/nn/nn without them being treated as dates.

Can anyone help?
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Thanks Hotpepper

I have it formatted as text - the challenge is how to force someone to put a / in positions three and six.
 
Upvote 0
Mrcann:

See if below what you want.
Select Cells A1
Data > Validation > Custom > Formula=AND(MID(A1,3,1)="/",MID(A1,6,1)="/")
 
Upvote 0
Thanks Stephen,

Data validation on my computer will not work with that formula, but it works a treat in the spreadsheet. :)

I have inserted a new column as a validation column, and have extended the formula a little as follows:

=IF(AND(MID(K2,3,1)="/",MID(K2,6,1)="/", VALUE(RIGHT(K2, 2))<100, VALUE(LEFT(K2, 2))<100, VALUE(MID(K2, 4, 2))<100), "Correct", "Incorrect")

Thanks!
 
Upvote 0

Forum statistics

Threads
1,224,509
Messages
6,179,192
Members
452,893
Latest member
denay

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