+ Reply to Thread
Results 1 to 8 of 8

date&time=text, not formattable

  1. #1
    Forum Contributor
    Join Date
    02-28-2013
    Location
    NY, USA
    MS-Off Ver
    Excel 2019
    Posts
    101

    date&time=text, not formattable

    I have a column of dates with different formats such as "16MAR2017", "06-Sep-2016", "12/17/2015" and others that contain time.
    When I used "text to columns" to split the date column, the field is split into "date" in one column, and "time" in a second column of time, all harmonized into one format respectively.

    However, when I concatenate the two new fields, the output turns into text and shown as for example "42810.036458333", which cannot be re-formatted back to date + time. "Isnumber" indicates the new field is indeed a text. Googling around did not find any solution.

    As I need to preserve the original content as much as possible, I do have to add the time back into those fields that contain time.

    Any help ? Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: date&time=text, not formattable

    If you're using CONCATENATE, that converts everything to text strings. Try just adding the two cells together, e.g. =A1+B1.
    If someone helped achieve your solution, consider clicking "* Add Reputation" on their post.

    If your question has been answered, mark the thread as [SOLVED] using the Thread Tools menu at the top of the thread.

  3. #3
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: date&time=text, not formattable

    You can use =VALUE(), =N(), =Text*1, =Text+0 etc to force text that can be evaluated to number into number.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  4. #4
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: date&time=text, not formattable

    When you have the two columns for "date" and "time", and you want to put them back together, don't concatenate them as text strings, just add them like numbers.
    Click the [* Add Reputation] Button to thank people for help!
    Post Attachment: Click [Go Advanced] under the reply box; then click [Manage Attachments] to launch the attachments dialogue.
    Mark Thread Solved: Go to the top of the first post; Select [Thread Tools] dropdown; Pick the [Mark thread as Solved] option.

  5. #5
    Forum Contributor
    Join Date
    02-28-2013
    Location
    NY, USA
    MS-Off Ver
    Excel 2019
    Posts
    101

    Re: date&time=text, not formattable

    Thanks a lot. It's very helpful !!
    A follow-up, as adding them creates a problem that for those dates without a time, now the new field shows 0:00, which could be interpreted as midnight 0:00, and confusing as some others do record 0:00 in the original content. THis might be a trivial problem, but I am trying to preserve the original content without adding new information.

  6. #6
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: date&time=text, not formattable

    Assuming time is in column B and date is in column A, you could do something like:
    Please Login or Register  to view this content.
    This checks to see if the time column is blank, and returns only a date if there's no time, and returns a date and time if there is a time.

  7. #7
    Forum Contributor
    Join Date
    02-28-2013
    Location
    NY, USA
    MS-Off Ver
    Excel 2019
    Posts
    101

    Re: date&time=text, not formattable

    Right. Sorry for my brain fart !

  8. #8
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: date&time=text, not formattable

    Some of what has been said whilst good advice in general.
    You can concatenate dates and time and use results in calculations.
    In the attached using two helper columns (E&H) which were finally hidden aided data entry.
    The secret is to get the formatting right.
    torachan.
    Attached Files Attached Files

+ 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] Change time in text to date/time format with AM/PM converted to 24hr
    By iantix in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-14-2018, 06:13 AM
  2. Replies: 7
    Last Post: 06-19-2017, 06:10 PM
  3. [SOLVED] Extract time from date and time text string
    By pattem2013 in forum Excel General
    Replies: 5
    Last Post: 09-07-2013, 03:20 AM
  4. Need to capture date data in a text string containing a date and time stamp
    By Grilleman in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-07-2013, 01:14 PM
  5. Converting Date:Time text to Date:Time value
    By kacharuk in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-13-2009, 04:20 AM
  6. Ediy Date & Time to change Time to Text
    By RodBoggy in forum Excel General
    Replies: 1
    Last Post: 01-18-2006, 10:30 AM
  7. Replies: 0
    Last Post: 08-23-2005, 12:24 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