4

# Basic excel question

Basic excel question

• ### Unbelievable client idiocy

Very basic question here!!

How can I say "If B12 is a negative number insert a 0"

### Replies (4) By accountright
16th Sep 2011 09:58

Formula

Formula                                  Description (Result)

=A2-A3                                   Second number subtracted from the first (0)

=IF(A2-A3=0,"",A2-A3)             Returns a blank cell when the value is zero (blank cell)

=IF(A2-A3=0,"-",A2-A3)             Returns a dash when the value is zero (-)

This is the basic formula - instead of a dash in the example put in a zero

Polly

Thanks (1) By nogammonsinanundoubledgame
16th Sep 2011 09:58

You do not say what should be entered if B12 is not a negative number, but making an assumption I suggest

=MAX(B12,0)

May need adjustment if B12 may contain text

With kind regards

Clint Westwood

Thanks (1) By jonspe
16th Sep 2011 10:51

excel

Using this:

=IF(B12<0,0,B12)

will produce in the cell in which the formula is entered:

The contents of B12, if B12 is equal to or greater than 0.

or

"0" if b12 is a negative number.

=IF(B12<0,"NEGATIVE NUMBER",B12)

Remember to enclose any non-numeric stuff in double inverted commas.

Thanks (2) 