+ Reply to Thread
Results 1 to 7 of 7

time formated cells stay blank if zero

  1. #1
    Registered User
    Join Date
    04-13-2011
    Location
    Bicester
    MS-Off Ver
    Excel 2003,2010
    Posts
    37

    time formated cells stay blank if zero

    I I am trying to create a spreadsheet to track my kids swimming times, I have created a basic version of it and attached it for viewing.

    I want a formula to leave cells blank if they are showing "00:00.00" (so is blank or = 0) but if they are showing a time then do the calculation.

    Example col B current cal show =MIN(J5:XFD5) for row 5 but as the selected range has no times in put 00:00.00 is returned.

    I have tried if statements (=if"","",) but I get errors I think because its time formatted.

    the cells are formatted as custom MM:SS.00 as we never go into hours.

    I also need a formula to leave the cells blank if they are negative numbers so I don’t get the ####### in the cell but I think this will be a slight change to the above if possible.

    I know I can use conditional formatting to colour the text but this is not a great option as I would like to use condition formatting for other purposes and have run out of options on certain cell in the mail workbook i have created so I really need a formula if possible.

    any help/ideas?
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: time formated cells stay blank if zero

    When doing calculations, it's not advisable to use a formula to force a text value of blank as this can cause errors when adding, subtracting etc. It's better to leave a zero in place. Excel has options to not display a zero. Click the office button, then click Excel options, Advanced, Display options for this worksheet. Remove the check from show a zero in cells that have a zero value. Also, you can force a positive by surrounding the formula with ABS(your formula here).
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: time formated cells stay blank if zero

    Hi.

    Please take a look at the attach file.
    Hope to be OK!
    Attached Files Attached Files
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Registered User
    Join Date
    04-13-2011
    Location
    Bicester
    MS-Off Ver
    Excel 2003,2010
    Posts
    37

    Re: time formated cells stay blank if zero

    Quote Originally Posted by tlafferty View Post
    When doing calculations, it's not advisable to use a formula to force a text value of blank as this can cause errors when adding, subtracting etc. It's better to leave a zero in place. Excel has options to not display a zero. Click the office button, then click Excel options, Advanced, Display options for this worksheet. Remove the check from show a zero in cells that have a zero value. Also, you can force a positive by surrounding the formula with ABS(your formula here).
    Ok I understand the issue with forcing blank but is it possible to create a formula that does this with finding the minimun value of a range as in the book1? as although your option will work I am get frustrated with the formula.

    not sure about the last bit "you can force a positive by surrounding the formula with ABS(your formula here)" can you explain this further maybe show me in the workbook and re-upload.

    cheers

    Darren

  5. #5
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: time formated cells stay blank if zero

    Hi there,
    Sorry about the delay in posting back. After looking at what you're trying to do, I decided to turn off the display of zeros:
    Please Login or Register  to view this content.
    Also, you asked me to explain the ABS formula: all it does is finds the absolute value. If the value entered is negative, it returns a positive (multiplies by negative one), if the value is positive, it remains positive.

    See attached workbook.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    04-13-2011
    Location
    Bicester
    MS-Off Ver
    Excel 2003,2010
    Posts
    37

    Re: time formated cells stay blank if zero

    Quote Originally Posted by tlafferty View Post
    Hi there,
    Sorry about the delay in posting back. After looking at what you're trying to do, I decided to turn off the display of zeros:
    Please Login or Register  to view this content.
    Also, you asked me to explain the ABS formula: all it does is finds the absolute value. If the value entered is negative, it returns a positive (multiplies by negative one), if the value is positive, it remains positive.

    See attached workbook.
    Thanks for the reply

    Ok Think I am getting to grips with the abs bit, I will play when I have more time.

    I have been playing again and I am struggling with the formula in cell B5, this where all my confusion started but then I went off at a tangent looking at other stuff too, I think the formula shows what I am trying to achieve but its retuning a #value.
    I’m not sure if I need it now but would be nice to know if its possible?
    If it is what am I doing wrong?
    If not is there a reason?

    Cheers

    Darren
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: time formated cells stay blank if zero

    The culprit is the formula in B5. It needs to be entered as an array so that it can compare more than one value. Select cell B5, click in the formula bar to activate edit mode, then press CTRL + Shift + Enter. If you did it correctly, your formula will be surrounded with curly braces:
    Please Login or Register  to view this content.
    Two things to pay attention to:
    1) If you enter edit mode on the formula again, you will have to confirm that is an array again by pressing CTRL + Shift + Enter.
    2) I replaced the "" part of your formula with a 0: J5:XDF5="",0

    This was done because although the "" suppressed the 0, it causes value errors in your other formula. Also, before entering your formula as an array caused an error, so the formula which points to the formula containing an error will also so an error.

+ 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