+ Reply to Thread
Results 1 to 17 of 17

need to get right date

  1. #1
    Registered User
    Join Date
    12-13-2023
    Location
    egypt
    MS-Off Ver
    365
    Posts
    10

    Post need to get right date

    Greeting to all

    as mentioned i need to get from only date like (14/12/2023) from (14/12/2023 21:20:34)
    i used =DATE(MID(J4,7,4), MID(J4,4,2), MID(J4,1,2)) but its not working in all cases like (6/1/2024 21:45) or (1/1/2024 20:18:59)

    need something to work with all cases

  2. #2
    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. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,235

    Re: need to get right date

    Try:

    =INT(J4)
    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.

  3. #3
    Registered User
    Join Date
    12-13-2023
    Location
    egypt
    MS-Off Ver
    365
    Posts
    10

    Re: need to get right date

    error #VALUE

  4. #4
    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. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,235

    Re: need to get right date

    No error if the date is real - see attached.

    Attach a workbook showing the error.

    Or try:

    =--LEFT(A1,10)
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-13-2023
    Location
    egypt
    MS-Off Ver
    365
    Posts
    10

    Re: need to get right date

    the problem seems to be in the report formatting 14/12/2023 21:20:34
    it sees 14 as year and 2023 as a day
    what should i do ?

  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. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,235

    Re: need to get right date

    Provide me with a workbook showing this. I cannot troubleshoot thin air.

    Here's what it looks like for me:

    AliGW on MS365 Beta Channel (Windows 11) 64 bit

    A
    B
    1
    14/12/2023 21:20
    14/12/2023
    Sheet: Sheet1

  7. #7
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: need to get right date

    --LEFT(A1,10) isn't working in all cases either. eg. not in case 1/1/2024 21:45. See Post #1

    Please try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and format cell as a date.

  8. #8
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: need to get right date

    it sees 14 as year and 2023 as a day
    what should i do ?
    Did you check the format of the cell?

  9. #9
    Registered User
    Join Date
    12-13-2023
    Location
    egypt
    MS-Off Ver
    365
    Posts
    10

    Re: need to get right date

    yes i attached file also

  10. #10
    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. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,235

    Re: need to get right date

    That's a CSV file, not an Excel workbook. The dates present as real dates, not text, so =INT(A2) works:

    AliGW on MS365 Beta Channel (Windows 11) 64 bit

    A
    B
    1
    created_at
    2
    06/01/2024 21:45
    06/01/2024
    3
    06/01/2024 21:17
    06/01/2024
    4
    01/01/2024 20:18
    01/01/2024
    5
    01/01/2024 20:17
    01/01/2024
    6
    30/12/2023 02:17
    30/12/2023
    7
    29/12/2023 02:17
    29/12/2023
    8
    20/12/2023 22:08
    20/12/2023
    9
    18/12/2023 12:46
    18/12/2023
    10
    17/12/2023 19:37
    17/12/2023
    11
    14/12/2023 21:20
    14/12/2023
    12
    14/12/2023 00:59
    14/12/2023
    13
    13/12/2023 03:55
    13/12/2023
    14
    13/12/2023 03:51
    13/12/2023
    15
    13/12/2023 03:47
    13/12/2023
    Sheet: Transactions_Export_21482__07_0

  11. #11
    Registered User
    Join Date
    12-13-2023
    Location
    egypt
    MS-Off Ver
    365
    Posts
    10

    Re: need to get right date

    after i saved the file to .xlsx INT(A2) still not working
    im not sure if i missing something here

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,683

    Re: need to get right date

    I saved as XLSX and INT(A2) worked as expected
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  13. #13
    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. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,235

    Re: need to get right date

    Quote Originally Posted by manshyworld View Post
    after i saved the file to .xlsx INT(A2) still not working
    im not sure if i missing something here
    If you open the .xlsx file I attached, you will see the INT function working. When you then save that to .csv, the formula results are changed into date values.

    You are either missing something or doing something wrong, because it works fine with your data.

  14. #14
    Registered User
    Join Date
    12-13-2023
    Location
    egypt
    MS-Off Ver
    365
    Posts
    10

    Re: need to get right date

    in my sheet the formation is 6/1/2024 21:45:16 while in your sheet 2024/1/06 21:45
    can you see the difference (Arrange - missing seconds)
    what did you do ?

  15. #15
    Registered User
    Join Date
    12-13-2023
    Location
    egypt
    MS-Off Ver
    365
    Posts
    10

    Re: need to get right date

    Quote Originally Posted by JohnTopley View Post
    I saved as XLSX and INT(A2) worked as expected
    i meant you

  16. #16
    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. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,235

    Re: need to get right date

    in my sheet the formation is 6/1/2024 21:45:16 while in your sheet 2024/1/06 21:45
    I don't understand - there is no formation like that in my workbook.

    But the second is just yyyy/m/dd hh:mm - it's the same data.

    Look at the attachment: columns C and E are the same dates, just formatted differently.
    Last edited by AliGW; 01-07-2024 at 01:33 PM.

  17. #17
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,683

    Re: need to get right date

    In my file A2>>B2

    06/01/2024 21:45:16 >>>06/01/2024

    A2 format is dd/mm/yyyy hh:mm

    B2 format is dd/mm/yyyy

+ 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. Replies: 4
    Last Post: 03-21-2018, 09:25 AM
  2. [SOLVED] Change Date with Date Picker If Date Less Than 7 Days From Another Date
    By Macfool in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-16-2016, 09:10 AM
  3. Week to date, Month to date, Qtr to date and Year to date
    By Neilesh Kumar in forum Excel General
    Replies: 4
    Last Post: 06-10-2016, 08:53 AM
  4. Counting if data falls on date between Start Date, End Date or Possible End Date
    By JessHasQuestions in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 07-26-2014, 08:01 AM
  5. Replies: 1
    Last Post: 10-02-2012, 02:42 PM
  6. Replies: 1
    Last Post: 09-28-2012, 08:52 AM
  7. Replies: 7
    Last Post: 11-16-2008, 05:48 PM

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