+ Reply to Thread
Results 1 to 4 of 4

DATE formula

  1. #1
    Registered User
    Join Date
    10-18-2019
    Location
    Belgrade
    MS-Off Ver
    OFFICE 365
    Posts
    2

    DATE formula

    Hi,
    I have following number from which I am extracting date, ie. 2302989870009. First two digits are for the day of the month, 3rd and 4th numbers are for the month, and 5th trough 7th are numbers for year, in this case 23/02/1989.
    I am using following formula to extract date from cell A2: DATE(MID(A2,6,2),MID(A2,3,2),MID(A2,1,2). The formula works fine until the year reaches 2000 or higher, ie 2302000870009. In that case I am getting year 1900 instead 2000.
    Is there any formula to solve this problem.
    Thanks in advance for any help.
    Regards
    Sasa

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: DATE formula

    =(left(a1,2)&"/"&mid(a1,3,2)&"/"&if(mid(a1,5,1)>"0",1,2)&mid(a1,5,3))+0

    What happens when the day is 1st - 9th ?
    The input will drop the leading 0 I believe
    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
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: DATE formula

    I was able to achieve this using Power Query/Get and Transform. I did use US date convention so that it would work on my system. You can adjust that. Here is the Mcode

    Please Login or Register  to view this content.
    and I have attached a file. Note that your data needs to be in text format for this to work.If you are unfamiliar with PQ, then check out the links in my signature .
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    10-18-2019
    Location
    Belgrade
    MS-Off Ver
    OFFICE 365
    Posts
    2

    Re: DATE formula

    Works fine with first solution, I will now check the second !
    Thanks a lot!

+ 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] Formula for converting a date to quarter and leaving blank cell for no date values
    By jayc2111 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-10-2019, 12:57 AM
  2. Replies: 4
    Last Post: 03-21-2018, 09:25 AM
  3. Replies: 7
    Last Post: 02-02-2017, 02:41 PM
  4. Replies: 5
    Last Post: 12-01-2015, 02:36 PM
  5. [SOLVED] Need FORMULA for Date subtract Date equal bussiness hour (don't count weekend)
    By tuongtu3 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-24-2015, 03:29 AM
  6. [SOLVED] Formula to compare date (including month and year) from a listed date to today's date
    By mhewitson15 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-11-2014, 05:31 PM
  7. Replies: 2
    Last Post: 11-03-2014, 10:29 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