+ Reply to Thread
Results 1 to 9 of 9

Date formula if positive show, if negative don't show.

  1. #1
    Forum Contributor
    Join Date
    11-11-2007
    Posts
    263

    Date formula if positive show, if negative don't show.

    =VALUE(TEXT((NOW()-E16)/24,"[h]"))

    This is the formula I'm using now, if I have a positive number I want it to show up, if the number is negative, I don't want it to show up. Is this possible?

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Date formula if positive show, if negative don't show.

    You can use an IF statement to return a blank, or Coditional Formatting to hide negative amounts.

    =IF(VALUE(TEXT((NOW()-E16)/24,"[h]"))<0,"",VALUE(TEXT((NOW()-E16)/24,"[h]")))
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Date formula if positive show, if negative don't show.

    This may be shorter a bit:
    =IF(NOW()-E16<0,"",VALUE(TEXT((NOW()-E16)/24,"[h]")))
    Quang PT

  4. #4
    Forum Contributor
    Join Date
    11-11-2007
    Posts
    263

    Re: Date formula if positive show, if negative don't show.

    Quote Originally Posted by royUK View Post
    You can use an IF statement to return a blank, or Coditional Formatting to hide negative amounts.

    =IF(VALUE(TEXT((NOW()-E16)/24,"[h]"))<0,"",VALUE(TEXT((NOW()-E16)/24,"[h]")))
    Thanks that works perfectly. I am now running into an issue in where I tried to make it so that it won't show up if no date it there, and I get an -40981. I tried to fix it by:

    =IF(VALUE(TEXT((E73-NOW())/24,"[h]"))>=0,"",VALUE(TEXT((E73-NOW())/24,"[h]"))),IF(E73,TODAY()-E73,0)

    Now I get an error, I really need to take an excel course again.
    Last edited by Cyberpawz; 03-13-2012 at 08:57 AM.

  5. #5
    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: Date formula if positive show, if negative don't show.

    Hi

    Give a try to this.

    =IF(OR(VALUE(TEXT((NOW()-E16)/24,"[h]"))<0,(VALUE(TEXT((NOW()-E16)/24,"[h]"))="",""),VALUE(TEXT((NOW()-E16)/24,"[h]"))))


    Hope to helps you.
    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.

  6. #6
    Forum Contributor
    Join Date
    11-11-2007
    Posts
    263

    Re: Date formula if positive show, if negative don't show.

    Quote Originally Posted by Fotis1991 View Post
    Hi

    Give a try to this.

    =IF(OR(VALUE(TEXT((NOW()-E16)/24,"[h]"))<0,(VALUE(TEXT((NOW()-E16)/24,"[h]"))="",""),VALUE(TEXT((NOW()-E16)/24,"[h]"))))


    Hope to helps you.
    I come back with a window that says formula contains an error.

  7. #7
    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: Date formula if positive show, if negative don't show.

    ....it won't show up if no date it there, and I get an -40981.
    From your post N0#4
    If there is no date, Where? In which cell?

    As you can understand, for all of us is very difficult, because we don't have a workbook to test our suggestions!

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

    Re: Date formula if positive show, if negative don't show.

    Try this formula

    =IF(OR(E16>NOW(),E16=""),"",INT(NOW()-E16))

    format formula cell as general
    Audere est facere

  9. #9
    Forum Contributor
    Join Date
    11-11-2007
    Posts
    263

    Re: Date formula if positive show, if negative don't show.

    Ok, I got this going well so far, but I am running into an issue. I have placed some conditional formatting using the equation, I am curious is there a way to make conditional formatting work so it only shows a specific word or icon if the condition is 0?

    I've looked around and so far I see >= but that is it, no =.

    Here is the sheet so far.
    Attached Files Attached Files

+ 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