+ Reply to Thread
Results 1 to 5 of 5

manual date picker formula doesnt work

  1. #1
    Registered User
    Join Date
    09-11-2019
    Location
    Latvia
    MS-Off Ver
    Office 365
    Posts
    2

    manual date picker formula doesnt work

    Hi!
    Need some help.
    I created some sort of Date Picker from 3 cells (A1: date 1-31, A2: month 1-12, and A3: years) dropdowns.
    Using Formula in a A4: =IFERROR(DATE(A1,A2,A3),"Not a proper date")
    Formula works as such, but if I pick from dropdowns 30.feb.2019, the formula returns 01.mar.2019...
    How can I fix this so i get in return that the date is not correct?
    Sadly on work PC I'm not allowed to use VBA or any add-ons.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: manual date picker formula doesnt work

    Excel will add the extra days so there is no error.

    Possibly an additional formula in B4 for example?

    Please Login or Register  to view this content.

  3. #3
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,885

    Re: manual date picker formula doesnt work

    Date value is stored as integer value in Excel.

    EDIT: So each integer value supplied to DATE() function will be converted to # of days first and added to form date value. Hence any overflow in Month/Day argument, just adds extra days to resulting date.
    EDIT2: Year argument has bit of special treatment. Values between 1-1899 is simply added to 1900. Values > 1900 is used as is. This is due to Excel's minimum date starting from 1/1/1900.

    Meaning, any combination of integer values in Cell A1, A2, A3 will result in valid date.

    Instead of using DATE() function, try using DATEVALUE.
    Ex:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    DATEVALUE converts string into date and will require that string as is, represent valid date.
    Last edited by CK76; 09-11-2019 at 09:51 AM. Reason: Added explanations
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  4. #4
    Registered User
    Join Date
    09-11-2019
    Location
    Latvia
    MS-Off Ver
    Office 365
    Posts
    2

    Re: manual date picker formula doesnt work

    Thanks, CK76!
    That's what I was looking for, and works for me just fine.
    Just - added "&" for the A1 cell in the formula.
    =IFERROR(DATEVALUE(A3&"-"&A2&"-"&A1),"Not a proper date")

  5. #5
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,885

    Re: manual date picker formula doesnt work

    Ah, forgot that when I typed it in.

    You are welcome and thanks for the rep

    If your question is answered, please mark the thread as solved by using thread tool found at top of your initial post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Date Picker doesn't work when workbook is reopened
    By TPDave in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-18-2020, 03:22 AM
  2. Infamous Date Picker does not work anymore
    By Sergey1989 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-01-2019, 11:11 AM
  3. [SOLVED] Date picker-Need it to default to today's date. Also getting error but it seems to work.
    By aliciaward1001 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-22-2017, 12:56 PM
  4. Replies: 0
    Last Post: 11-23-2015, 04:50 AM
  5. Formula doesnt work until the date
    By monkeytusmc in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-31-2015, 02:49 AM
  6. pop up date picker wont work when sheet is protected
    By jamie.c in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-17-2009, 11:28 AM
  7. Formatting from Text to Date ; doesnt work
    By babarorhum in forum Excel General
    Replies: 1
    Last Post: 09-18-2008, 10:50 AM

Tags for this Thread

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