+ Reply to Thread
Results 1 to 3 of 3

Force cell date format

  1. #1
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Question Force cell date format

    Hi folks

    A question i'm sure most of you can help with:

    I need to force the date in column b to always default to the following format

    DD/MM/YYYY

    Because some idiots like to put is like this:

    DD.MM.YYYY

    even if i format the cell to have the format that i desire the user can still enter the date with the fullstops!!

    any idea's on how to stop this?

    I Appreciate you reading this and cheers for any help folks!!
    Mr MaGoo
    Magoo.Inc MMVII

    If i've helped please add to my Rep by Clicking on the Blue Scales in the top right hand corner of the post

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,080
    Use a helper cell to turn it into TEXT

    Perform the following checks using IF/AND conditions

    1) Is the LENgth of the value input 10 characters ?
    2) Are the 3rd and 6th characters "/" ?
    3) Is the VALUE of the first 2 characters from 1 to 31 ?
    4) Is the VALUE of the 4th and 5th characters from 1 to 12 ?
    5) Is the VALUE of characters 7-10 from 1900 to 2007 (you'll have to change these two values depending on what years are valid) ?

    If all these conditions are true then a date has been entered in the format DD/MM/YYYY

    You may want to check that the date (DD) entered conforms to the numbers of days in the month (MM) entered, and allowing for leap years in the year (YYYY)
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    09-20-2007
    Location
    Miami, FL
    Posts
    2

    Talking

    Maybe an easier way... (pardon if wrong, I am a newbie)

    I have the same issue, in that the cell is format for MM/DD/YY but it will allow the entry of MM//DD/YY (notice the extra slash). Then, calculations fail.

    I set VALIDATION for the cell to only allow dates between 1/1/1900 and 1/1/2199. To validate the date, excel checks it and gives out an error. I tried and it won't allow the dots either. And is easier than all the ifs and ands...

    Hope that helps.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1