+ Reply to Thread
Results 1 to 14 of 14

If >0 = Value of cell and if <0 = 0

  1. #1
    Registered User
    Join Date
    03-13-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    7

    If >0 = Value of cell and if <0 = 0

    How do I syntax this?
    =IF(E2>0,E2,0)
    Buzz

  2. #2
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: If >0 = Value of cell and if <0 = 0

    Try this:

    Please Login or Register  to view this content.
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: If >0 = Value of cell and if <0 = 0

    Hi,

    Can you be more precise with your title. Zero meets both conditions.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: If >0 = Value of cell and if <0 = 0

    I read that as zero meeting neither of the conditions...
    If I've been of help, please hit the star

  5. #5
    Registered User
    Join Date
    03-13-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: If >0 = Value of cell and if <0 = 0

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    Can you be more precise with your title. Zero meets both conditions.
    If the value of the cel is greater than "0" i want to return the value of the cell.

    If it is less than "0" I just want zero (or blank)

  6. #6
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: If >0 = Value of cell and if <0 = 0

    buzz, welcome to the forum.

    What if the value of the cell is 0? That possibility is not covered in your elaboration (post # 5)
    Brendan.


    __________________________________________________________________________________________________
    Things to consider:

    1) You can thank any poster by clicking the * at the left of a helpful post.
    2) You can help to keep the forum tidy by marking your thread as "Solved", if it has been answered to your satisfaction.
    3) Help us to help you, by uploading a sample workbook, showing the type of data you're dealing with, and clearly indicating what the results should be.

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

    Re: If >0 = Value of cell and if <0 = 0

    =IF(E2>0,E2,0) doesnt that work as it is?
    "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

  8. #8
    Registered User
    Join Date
    03-13-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: If >0 = Value of cell and if <0 = 0

    That worked great but I have to use a hidden cell.
    How can I combine into one formula?
    D2 = start time (10:30 AM)
    C2 = stop time (3:30 PM)

    E2=(D2-C2)*24
    =MAX(E2,0)

  9. #9
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: If >0 = Value of cell and if <0 = 0

    I'm confused Buzz....if I put data in column A that has positve and negative numbers and some zeros. And then in column B use either your formula (changing the E to an A) or using ConneXionLost MAX formula, I get the results that you are requesting in your last post...

    Ernest

  10. #10
    Registered User
    Join Date
    03-13-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: If >0 = Value of cell and if <0 = 0

    Yea it wrks but now I'm trying to use that fromula with the result of this formula.
    I can accomplish in 2 cells but I'm sure there's a way to write it together.
    =(D2-C2)*24
    =IF(E2>0,E2,0)

  11. #11
    Registered User
    Join Date
    03-13-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: If >0 = Value of cell and if <0 = 0

    no help judge?

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

    Re: If >0 = Value of cell and if <0 = 0

    max((D2-C2)*24,0) surely?

  13. #13
    Registered User
    Join Date
    03-13-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: If >0 = Value of cell and if <0 = 0

    Thanks, I'm horribly out of practice with this stuff.

  14. #14
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: If >0 = Value of cell and if <0 = 0

    Sorry Buzz....it was passed the end of my day....looks like Mr. Wilson did a great job....

    Ernest

+ 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