+ Reply to Thread
Results 1 to 5 of 5

Datevalue #Value error?

  1. #1
    Forum Contributor
    Join Date
    03-14-2005
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    329

    Datevalue #Value error?

    Hello.

    I try to convert the date 2007-01-01 in cell E3 with datevalue(E3).

    It does return a #Value! error. Any ideas about what can be wrong?
    Cell E3 is formatet as a date.

    /Anders

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Datevalue() converts a date entered as a text string to a numeric date.

    So if E3 is already formatted as a date, then you don't need datevalue()

    What are you trying to accomplish?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor
    Join Date
    03-14-2005
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    329
    Hello.

    I need to convert 2007-01-01 to a numeric value that excel uses to determain which date it is.
    2007-01-01 - -> 39083

    How do I do that?

    /Anders

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Excel already uses those 5 digit numbers when dealing with dates. If you change the format of the cell to General you will see that it displays that 5-dig number. So adding 2 cells with dates in them will add correctly.....

    Still not sure if your original date is true date or a text string...try =E3+0 this will definitely ensure it is converted to a true date value. Then go to Format|Cells and pick General.

  5. #5
    Valued Forum Contributor
    Join Date
    12-16-2004
    Location
    Canada, Quebec
    Posts
    363
    I would try this formula

    =DATEVALUE(MONTH(E3) & "/" & DAY(E3) & "/" & YEAR(E3))
    Denis

    Please always attach the sample workbook without sensitive information when asking for help

    To add a module
    Press Alt + F11 (this is the Visual Basic Environment)
    Insert Menu, select Module
    Past code there
    Close Visual Basic Environment (X)

+ 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