+ Reply to Thread
Results 1 to 6 of 6

Formula prblem with time

  1. #1
    Registered User
    Join Date
    03-05-2014
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Formula prblem with time

    I have to calculate time in a cell which I have but if no time is entered I want the cell to be blank. ow it reads 0:00s.
    Here is what I have.
    Cell A1 is time in
    Cell A2 is time out
    Cell A3 is total time worked.
    The formula for the time I have is correct because it has to cover a 24 hour period but what do I add to this to return a blank cell instead of 0s.
    =(B1-A1+(B1<A1))*24

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,633

    Re: Formula prblem with time

    provided what you wrote is right, try:
    Please Login or Register  to view this content.
    and what is more important: remember to format A3 after correcting formula as General (not time) format.
    Best Regards,

    Kaper

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

    Re: Formula prblem with time

    =IF(B1-A1=0,"",(B1-A1+(B1<A1))*24) or slightly shorter

    =IF(B1-A1=0,"",MOD(B1-A1,1)*24)
    "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

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,633

    Re: Formula prblem with time

    ... or to get rid of 0's not really general, but Custom format:
    "General,General,,@"
    yes, there are two commas after second general and before @


    as usual, even with simple problem a small attached workbook with few pieces of data and desired "manualy calculated" result would make helping easier.

  5. #5
    Registered User
    Join Date
    03-03-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Formula prblem with time

    Hi,

    Am new to this site which i find really awesome. Am not an expert in excel but i do like playing around with formulas. I have a quick (and hopefully easy) problem which I would want to ask help with:
    I am calculating time duration (minutes) and both my Time Start (E7) and Time End (F7) are formatted as "Custom=> 0":"00" so it is easy to type the time (no need to manually press shift and colon). The simple formula for the duration (G7) is F7-E7 which results to 0:00 with the same format of custom=>0":"00. Help?

    Thanks!
    Last edited by joeydcaro; 03-11-2014 at 05:48 AM. Reason: Add'l info

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

    Re: Formula prblem with time

    joeydcaro
    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

  7. #7
    Registered User
    Join Date
    03-03-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Formula prblem with time

    My apologies.

    As mentioned, I am new here in this site and learning the ropes, so to speak.
    Will post my question in a new thread.

    Regards,

  8. #8
    Registered User
    Join Date
    03-03-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Formula prblem with time

    My apologies.

    As mentioned, I am new here in this site and learning the ropes, so to speak.
    Will post my question in a new thread.

    Regards,

+ 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. Replies: 3
    Last Post: 12-19-2013, 06:49 AM
  2. Replies: 5
    Last Post: 04-18-2013, 11:31 AM
  3. Formula for Calculating Paid Time Off for fiscal anniversary date real time
    By 168rockwood in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-07-2012, 04:15 PM
  4. Replies: 2
    Last Post: 04-27-2011, 08:21 AM
  5. lookup prblem.
    By Motty in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-01-2005, 12:26 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