+ Reply to Thread
Results 1 to 5 of 5

Replacing a negative number with a 0 in a formula output

  1. #1
    Registered User
    Join Date
    01-16-2013
    Location
    northleach
    MS-Off Ver
    Excel 2010
    Posts
    28

    Replacing a negative number with a 0 in a formula output

    =LOOKUP(2,1/(D18:D22<>""),D18:D22)

    If the number is negative, I want it to put 0 in the box (not the negative). Can anyone help, please?

    Tom

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

    Re: Replacing a negative number with a 0 in a formula output

    Try

    =MAX(0,LOOKUP(2,1/(D18:D22<>""),D18:D22))
    Audere est facere

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Replacing a negative number with a 0 in a formula output

    =if(=LOOKUP(2,1/(D18:D22<>""),D18:D22)<=0,0,=LOOKUP(2,1/(D18:D22<>""),D18:D22))

    Not sure if your formula works or not, but that will give you your zero
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Replacing a negative number with a 0 in a formula output

    =if(lookup(2,1/(d18:d22<>""),d18:d22)<0,0,lookup(2,1/(d18:d22<>""),d18:d22))
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  5. #5
    Registered User
    Join Date
    01-16-2013
    Location
    northleach
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Replacing a negative number with a 0 in a formula output

    thanks, that's sorted !!

+ 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