+ Reply to Thread
Results 1 to 9 of 9

Adding Time to a date cell

  1. #1
    Registered User
    Join Date
    12-12-2010
    Location
    Derby, England
    MS-Off Ver
    Excel 2003
    Posts
    14

    Adding Time to a date cell

    Hi,

    I am trying to create a formula that can automatically add the time to the date in column A. I have the right custom number category at it works if I copy and paste it, I just have 200 plus to do so I need a formula to do it.

    Column A Column B

    01/01/10 09:34:00
    02/01/10 10:24:00
    03/01/10 11:00:00

    I have tried and failed many A2+B2 type formaulas but am completely confuddled.

    Any help would be greatly appreciated

    Thankyou Ben

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: Adding Time to a date cell

    Good afternoon Avinit

    Try something like :
    =VALUE(A1&B1)

    In the case of your first example, this would return 401790.3986 - then just format it as required, for example a custom format of dd/mm/yy hh:mm:ss should do it for you.

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Registered User
    Join Date
    12-12-2010
    Location
    Derby, England
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Adding Time to a date cell

    Thanks for the quick reply Dominic

    When I try what you have suggested I can seem to get it to work. It comes out with the a VALUE error.

    I have tried changing the formats of the numbers (and see that 01/01/10 is 40179) but it doesnt seem to want to add them together for me.

    I am probably doing something stupid, but still cant figure out why.

    Thanks

    Ben

  4. #4
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Adding Time to a date cell

    I think if you try =value(a1&" "&b1)

    or just

    =--(a1&" "&b1)
    Regards
    Darren

    Update 12-Nov-2010 Still job hunting!

    If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.

    Learn something new each day, Embrace change do not fear it, evolve and do not become extinct!


  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Adding Time to a date cell

    a1+b1 works for me
    format both cells as general what do they say? if they both show numbers 40179 and 0.398611111
    than a simple add works fine
    Last edited by martindwilson; 12-13-2010 at 10:21 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  6. #6
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Adding Time to a date cell

    I'm assuming at least one of the values is text rather than a time/date

  7. #7
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Adding Time to a date cell

    Attaching a sample of your data might help

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Adding Time to a date cell

    If your values are valid times and dates (or even text-formatted without additional characters) then

    =A2+B2

    should work fine. Looks like the date is valid so perhaps the time isn't. Try

    =A2+MID(B2,FIND(":",B2)-2,8)

    format as dd/mm/yy hh:mm:ss or similar
    Audere est facere

  9. #9
    Registered User
    Join Date
    12-12-2010
    Location
    Derby, England
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Adding Time to a date cell

    Thanks for all your help guys.

    I had inherited this sheet from someone else and as such didnt know what form the data was in.

    Trying your suggestions on a blank sheet worked fine, so I had another look at what was in my original sheet and there the seconds were input as a decimal place instead of :

    Thanks to all for your help.

    Its sometimes the simple things you dont see that provide the biggest challenges.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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