+ Reply to Thread
Results 1 to 8 of 8

Missing Zeros for Day and Mont: DATE Function problem

  1. #1
    Registered User
    Join Date
    04-23-2022
    Location
    Canada
    MS-Off Ver
    365
    Posts
    4

    Missing Zeros for Day and Mont: DATE Function problem

    Good afternoon,

    I've been trying to figure out a way to use the date function to create a date from text (downloaded .csv file). The problem is the date in the .csv document has 8, 9 or 10 characters because of the text format of the date. I've attached a sample of the data, but essentially this is the issue:

    12/30/2021
    1/8/2022
    1/11/2022

    I've tried using DATE, including the usual, RIGHT, LEFT, MID functions. I've also tried to use a IF - LEN combination but no success. I'm sure I am missing something fairly basic here but would appreciate any help you can provide. I did try to search for solutions but most seems to want to get rid of zeros, while I am trying to either add them, or account for their absence in my formula.

    Thank you in advance for your help.
    Attached Files Attached Files

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Missing Zeros for Day and Mont: DATE Function problem

    Maybe this?
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    BSB

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

    Re: Missing Zeros for Day and Mont: DATE Function problem

    One way... of many:

    =DATE(RIGHT(A2,4),LEFT(A2,FIND("/",A2)-1),SUBSTITUTE(MID(A2,FIND("/",A2)+1,255),RIGHT(A2,5),""))
    Attached Files Attached Files
    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.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Registered User
    Join Date
    04-23-2022
    Location
    Canada
    MS-Off Ver
    365
    Posts
    4

    Re: Missing Zeros for Day and Mont: DATE Function problem

    You are a scholar and a gentleman. Thank you, that works like a charm. It would have taken me a long time to get there...if at all.

  5. #5
    Registered User
    Join Date
    04-23-2022
    Location
    Canada
    MS-Off Ver
    365
    Posts
    4

    Re: Missing Zeros for Day and Mont: DATE Function problem

    Thank you as well for the quick reply. What a great forum.

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

    Re: Missing Zeros for Day and Mont: DATE Function problem

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please select "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.

  7. #7
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Missing Zeros for Day and Mont: DATE Function problem

    Glad we could help

    BSB

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Missing Zeros for Day and Mont: DATE Function problem

    You can use text to columns on the Data ribbon:

    1. Select column A.
    2. Data | Text to Columns - next - next - select MDY - finish.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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. Distinguishing between missing data and zeros in pivot charts
    By alexpeppe in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 11-02-2018, 09:34 AM
  2. Excel Macro to find missing dates and insert missing date as blank row
    By JevaMarie in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-26-2013, 11:08 AM
  3. Leading zeros is missing when saved in .csv format
    By vijanand1279 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-02-2013, 04:29 PM
  4. Problem with midnight date change using VBA macro for adding missing dates
    By ABoon86 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-11-2012, 10:20 AM
  5. Replies: 5
    Last Post: 04-09-2012, 02:28 PM
  6. Missing Zeros & Concactenate Failure
    By killertofu in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-14-2006, 11:49 PM
  7. Need formula to have date in cell B2 rounded to first of next mont
    By RamseyR in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-20-2005, 04:05 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