# Need to replace negative number with a zero

1. ## 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. ## Re: Need to replace negative number with a zero

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

3. ## Re: Need to replace negative number with a zero

Maybe

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

4. ## Re: Need to replace negative number with a zero

This worked. Thank you so much.

5. ## Re: Need to replace negative number with a zero

You're welcome.

##### Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### 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