+ Reply to Thread
Results 1 to 5 of 5

Need to replace negative number with a zero

  1. #1
    Registered User
    Join Date
    11-16-2014
    Location
    San Antonio, Texas
    MS-Off Ver
    Vista
    Posts
    2

    Need to replace negative number with a zero

    I need to change the formula so that a zero is returned instead of a negative number when H9<E9.

    =IF(H9>G9,H9-G9,IF(H9<G9,H9-E9,0))

    I have not used Excel since the early 90's when taking a college class. I recently volunteered for a non-profit that desperately needs help and am building some spreadsheets so they can automate some of their record keeping. Any assistance is greatly appreciated.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Need to replace negative number with a zero

    Try
    =IF(H9>G9,H9-G9,IF(H9<G9,MAX(0,H9-E9),0))

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,577

    Re: Need to replace negative number with a zero

    Maybe

    =MAX(IF(H9>G9,H9-G9,IF(H9<G9,H9-E9,0)),0)
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    11-16-2014
    Location
    San Antonio, Texas
    MS-Off Ver
    Vista
    Posts
    2

    Re: Need to replace negative number with a zero

    This worked. Thank you so much.

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Need to replace negative number with a zero

    You're welcome.

+ 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. [SOLVED] SUMIF positive and negative numbers - take double a negative number?
    By Zordrail in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-16-2014, 08:34 AM
  2. Replies: 1
    Last Post: 11-20-2008, 01:52 AM
  3. [SOLVED] How do I replace a negative number with zero
    By Laura@Gage in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-08-2005, 06:17 PM
  4. How do I replace a negative number with zero
    By Laura@Gage in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-07-2005, 09:06 PM
  5. [SOLVED] 2003= negative number&2004= negative number How Do I Calculate gro
    By Jason in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-14-2005, 02:06 PM

Tags for this Thread

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