+ Reply to Thread
Results 1 to 12 of 12

#VALUE error while changing date format

  1. #1
    Registered User
    Join Date
    07-19-2022
    Location
    India
    MS-Off Ver
    2019
    Posts
    16

    #VALUE error while changing date format

    I have some dates in text format and I want to change them into date format(number format). I am using DATEVALUE function but it is showing #VALUE error.
    I have also tried changing my system's date format but nothing seems working. I have attached an example workbook.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    07-13-2021
    Location
    California, USA
    MS-Off Ver
    2010
    Posts
    513

    Re: #VALUE error while changing date format

    @Rchamoli.... Your data are not "dates in text format". Instead, they are numeric Excel dates that are displayed with a Custom format.

    For example, A3 is the numeric value 28101. It appears to be 07-12-1976 because of the Custom format dd-mm-yyyy .

    The DATEVALUE function wants to see the text "07-12-1976" (if your system date form is DMY), for example, which can be entered in many ways.

    But why are you using DATEVALUE, in the first place, if your data are already numerice Excel dates?

    Note: Crossposted to https://answers.microsoft.com/en-us/...0-1792d5bffaed .

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,030

    Re: #VALUE error while changing date format

    Try this:

    =A3+0

    Set column B formatting to SHORT DATE.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    07-19-2022
    Location
    India
    MS-Off Ver
    2019
    Posts
    16

    Re: #VALUE error while changing date format

    The dates are coming in left which means they are in text format.... they must come in right side of the cell to be in number format... that is what i am unable to do...

  5. #5
    Registered User
    Join Date
    07-19-2022
    Location
    India
    MS-Off Ver
    2019
    Posts
    16

    Re: #VALUE error while changing date format

    Thanks @AliGW it worked in my example workbook but the problem remains same in my main workbook. What could be the reason??

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,030

    Re: #VALUE error while changing date format

    Let's see a workbook that shows the problem, please.

    Try:

    =TRIM(A3)+0

  7. #7
    Registered User
    Join Date
    07-19-2022
    Location
    India
    MS-Off Ver
    2019
    Posts
    16

    Re: #VALUE error while changing date format

    I have attached a reference workbook
    Attached Files Attached Files

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: #VALUE error while changing date format

    You have applied a left alignment in column B... so the values align to the left.

    Remove it.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,030

    Re: #VALUE error while changing date format

    Both my suggestions work. Change the column B formatting to GENERAL and you will see a 5-digit serial number- this PROVES that the text has been converted to a date.

    You need to better understand how dates are handled by Excel and how to determine what is and what is not a date.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: #VALUE error while changing date format

    We now know you have also cross-posted here:

    https://chandoo.org/forum/threads/va...-format.48898/



    Every forum has its rules. Please see Forum Rule #3 about cross-posting. So.

    Do not keep it a secret. We all are willing to give you our time, freely. However, some of us get very annoyed if we waste our time developing a solution for you, when you already have a nice solution elsewhere. All we ask is that you show us some respect and tell us:

    1) if you have cross-posted ANYWHERE ELSE, and

    2) the URL of the cross posts.

    That way, those of us who don't want to waste their time can quickly check to see if you're already happy with another solution.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)

  11. #11
    Valued Forum Contributor
    Join Date
    07-13-2021
    Location
    California, USA
    MS-Off Ver
    2010
    Posts
    513

    Re: #VALUE error while changing date format

    Quote Originally Posted by Rchamoli View Post
    The dates are coming in left which means they are in text format
    Looks can be deceiving, and the format of the cell does not matter.

    Use formulas like =ISTEXT(A3) and =ISNUMBER(A3) to determine the type of the cell value.


    -----
    Quote Originally Posted by Glenn Kennedy View Post
    Note: this requirement is not optional. No help to be offered until the link is provided.
    Sorry, I did not see that until after I submitted. But I think it is only fair that I be able to "defend" comments that I had posted before your restriction.
    Last edited by curiouscat408; 09-10-2022 at 04:23 AM.

  12. #12
    Registered User
    Join Date
    07-19-2022
    Location
    India
    MS-Off Ver
    2019
    Posts
    16

    Re: #VALUE error while changing date format

    I am so Sorry for that @glenn kennedy ... I will keep that in mind from next time.

+ 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] Excel not changing from american date format to UK format.
    By tweacle in forum Excel General
    Replies: 7
    Last Post: 08-30-2020, 08:01 AM
  2. [SOLVED] Changing date as string to date format
    By Baldev Kumar in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 06-06-2020, 05:27 PM
  3. [SOLVED] Changing US date format to UK format - using a formula
    By menolas in forum Excel Formulas & Functions
    Replies: 24
    Last Post: 10-27-2016, 07:07 AM
  4. [SOLVED] Formula for Changing date format 3-12-13 to format d-mm-yy.
    By UNAB in forum Excel General
    Replies: 2
    Last Post: 04-08-2013, 03:52 PM
  5. [SOLVED] Changing Multiple sheet names by wk ending date for yr but need specific name/date format
    By kedeling in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2013, 02:40 PM
  6. Formula required for date without changing the date format
    By suryaprasad in forum Excel General
    Replies: 1
    Last Post: 01-28-2009, 08:04 AM
  7. Changing date serial numbers to date format
    By rdunne in forum Excel General
    Replies: 1
    Last Post: 04-14-2005, 08:06 AM

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