+ Reply to Thread
Results 1 to 8 of 8

Remove : from date

  1. #1
    Registered User
    Join Date
    11-26-2020
    Location
    india
    MS-Off Ver
    2007
    Posts
    5

    Remove : from date

    Hi Team,

    I have date format like this: 30-Sep-2020: 6:00:00 AM
    I want to print yyyy-mm-dd hh:mm:ss.
    without colon after year i am getting the above format with text and datevalue function.
    but with colon i am not getting required format. I want to write the formula with text or some other functions.
    Please tell me how to remove colon.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Remove : from date

    Administrative note

    Welcome to the forum

    in your haste to solve your problem, you probably missed the yellow banner advising how to get answers faster by posting a sheet ?

    Please take a moment to read it and attach a sheet accordingly.

    Thanks you for helping us help you

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Remove : from date

    Try:

    =DATEVALUE(LEFT(A1,11))+TIMEVALUE(RIGHT(A1,11))

    With A1 is date-string
    Quang PT

  4. #4
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Remove : from date

    alternatively

    =SUBSTITUTE(A1,":","",1)+0

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Remove : from date

    Quote Originally Posted by XLent View Post
    alternatively

    =SUBSTITUTE(A1,":","",1)+0
    should be:

    =SUBSTITUTE(A1,": "," ",1)+0

    to prevent time-string changing

  6. #6
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Remove : from date

    No - I am afraid that assertion is incorrect; the use of 1 as optional fourth parameter ensures only the first semi-colon is replaced, the time serial is completely unaffected.
    Last edited by XLent; 11-26-2020 at 04:45 AM. Reason: reworded

  7. #7
    Registered User
    Join Date
    11-26-2020
    Location
    india
    MS-Off Ver
    2007
    Posts
    5

    Re: Remove : from date

    Thanks for your reply..
    can we pass required date format with DATEVALUE like yyyy-mm-dd hh:mm:ss

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Remove : from date

    Custom format the cell or using

    =TEXT("Working_formula","yyyy-mm-dd hh:mm:ss")

+ 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] remove text around date
    By sick stigma in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-13-2020, 12:48 PM
  2. Replies: 2
    Last Post: 05-21-2014, 02:26 PM
  3. [SOLVED] Remove the date from a date + time
    By Ariadust in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 10-11-2012, 11:33 AM
  4. Chart - how to remove the date?
    By tavlrb in forum Excel General
    Replies: 1
    Last Post: 07-01-2011, 03:42 AM
  5. Pivot Automation: Remove earliest date and add 1 date (Rows)
    By 4am in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-03-2011, 04:50 PM
  6. Help! How can I remove the date from a timestamp?
    By juddh in forum Excel General
    Replies: 1
    Last Post: 09-23-2009, 12:14 PM
  7. how to remove date from a cell
    By legolas in forum Excel General
    Replies: 2
    Last Post: 05-22-2008, 02:50 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