+ Reply to Thread
Results 1 to 4 of 4

Excel Time formatting for multiple times in a single cell

  1. #1
    Registered User
    Join Date
    03-10-2010
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    63

    Excel Time formatting for multiple times in a single cell

    Good Day all,

    I have a question I'm sure there is a fairly simple solution to. Basically I want to take a time IE 07:15 and in the next cell over I want to show the "time bank" that that time falls into. For example, 07:15 would fall into the 0700-0800 "time bank". etc etc. Right now I'm using a formula that looks like this:

    Please Login or Register  to view this content.
    where B4 contains the time. Most of the time I get the result I'm looking for, IE if the Time is 21:15 then the formula result will be 2100-2200, which is exactly right.

    Unfortunately when it calculates a time under 1000, IE 07:15, I get the result: 0700-800, instead of 0700-0800. Is there a way to make sure that its always 4 digits for each portion of the "time bank"?

    Is there a better formula to use to get the result I'm looking for?

    Any assistance would be greatly appreciated.

    Chris

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Excel Time formatting for multiple times in a single cell

    hi Chris, how about adding a decimal of 1/24 instead? because time is actually represented in decimals in Excel.
    =TEXT(B4,"HH")&"00-"&TEXT(B4+1/24,"HH")&"00"

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    07-01-2010
    Location
    High Wycombe
    MS-Off Ver
    Excel 2003
    Posts
    95

    Wink Re: Excel Time formatting for multiple times in a single cell

    Hello,

    I have taken a look at this & amended the formula you have been using & it seems work ok, I tried several examples for times.

    Please Login or Register  to view this content.
    I have removed the +1 & added into the second TEXT formula the value of "B4+0.05" which will add 1 hour to the B4.

    Hope this helps.

    Best Regards

    Jamesr571

    P.S: if this has helped resolve the query please click on the star of this reply.

  4. #4
    Registered User
    Join Date
    03-10-2010
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    63

    Re: Excel Time formatting for multiple times in a single cell

    Thank you both for the replies. Both work perfectly.

    Chris

+ 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