+ Reply to Thread
Results 1 to 9 of 9

Concatenate Date and Time - Issue with Formatting

  1. #1
    Registered User
    Join Date
    03-20-2017
    Location
    Memphis, TN
    MS-Off Ver
    2013
    Posts
    18

    Concatenate Date and Time - Issue with Formatting

    I'm trying to concatenate two cells - the first with the date and the second with the time. When I concatenate, however, instead of showing as 10/28/16 11:57 AM it returns a value of 42671 0.497916666666667.

    I've tried everything but can't seem to get it to format correctly.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Concatenate Date and Time - Issue with Formatting

    Welcome to the board.

    Don't use concatenate, just use plain math.

    =A1+B1

    A1 = Date
    B1 = Time

  3. #3
    Registered User
    Join Date
    03-20-2017
    Location
    Memphis, TN
    MS-Off Ver
    2013
    Posts
    18

    Re: Concatenate Date and Time - Issue with Formatting

    Thank you so much, Jonmo1! Worked like a charm.

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Concatenate Date and Time - Issue with Formatting

    Oh no! Beaten to the draw....
    same solution as above


    Welcome to the forum
    Dates are integers
    Times are values less than 1 and represent the fraction of a day - so 6am = 0.25, 12noon = 0.5, 6pm = 0.75 etc
    42671 = 28 Oct 2016
    0.497916666666667 = 11:57 am

    If you want the cell to show
    28 Oct 2016 11:57

    Then with value 1 in cell A1, value 2 in cell A2, result in cell A3, the formula in A3 is
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And then you need to FORMAT the cell using custom format
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    (amend to suit your needs)


    CustomFormatTime.jpg
    Last edited by kev_; 03-20-2017 at 02:42 PM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Concatenate Date and Time - Issue with Formatting

    You're welcome.

  6. #6
    Registered User
    Join Date
    03-20-2017
    Location
    Memphis, TN
    MS-Off Ver
    2013
    Posts
    18

    Re: Concatenate Date and Time - Issue with Formatting

    One more quick question if you guys don't mind.

    I took the Order Release Date of 3/10/187 1:32 PM minus the Order Received Date of 2/16/17 2:24 PM to create the Time to Release of 0:06:03 (6 minutes and 3 seconds). How do I add a column to report orders released within 1 hour, 2 hours, 24 hours, 48 hours and over 48 hours?

  7. #7
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Concatenate Date and Time - Issue with Formatting

    Assuming cell C2 has this Time to Release value.
    Try
    =IF(C2>2,"Over 48",IF(C2>1,"Within 48",IF(C2>"2:00:00"+0,"Within 24",IF(C2>"1:00:00"+0,"Within 2","Within 1"))))

  8. #8
    Registered User
    Join Date
    03-20-2017
    Location
    Memphis, TN
    MS-Off Ver
    2013
    Posts
    18

    Re: Concatenate Date and Time - Issue with Formatting

    Beautiful! I was trying to do a lookup, but figured there had to be an easier way. Thank you!

  9. #9
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Concatenate Date and Time - Issue with Formatting

    Actually, lookup would be the easier way.

    Just need a numeric representation of "1:00:00" and "2:00:00"

    1:00:00 = 1 hour, 1 24th of a day, 1/24, 1 devided by 24 = 0.041667
    2:00:00 = 2 hours, 2 24th of a day, 2/24, 2 devided by 24 = 0.83333

    We can use those 2 numbers in our lookup table along with 0 1 and 2

    =LOOKUP(C2,{0, 0.041667, 0.83333, 1, 2},{"Within 1", "Within2", "Within 24", "Within 48", "Over 48"})

+ 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] Formatting Date to MM-DD-YY while using CONCATENATE
    By kbdavis in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-11-2015, 06:16 PM
  2. concatenate date and time
    By jej in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-06-2014, 09:09 AM
  3. [SOLVED] Issue with Concatenate and keeping some custom formatting
    By DDR in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-23-2012, 05:50 PM
  4. formatting a date... & CONCATENATE question.
    By favian in forum Excel General
    Replies: 8
    Last Post: 11-02-2009, 11:59 AM
  5. merge date/time value , concatenate ?
    By okl in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-03-2008, 07:15 AM
  6. Concatenate Date and Time
    By Jim15 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-12-2008, 10:14 AM
  7. Date and Time Concatenate Help
    By Mr Gow in forum Excel General
    Replies: 3
    Last Post: 01-22-2007, 10:44 PM

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