Very basic question here!!

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

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

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

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 instead of just a non-descript "0" you want something more informative, do something like:

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

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

thanks very much

## Replies (4)

## Please login or register to join the discussion.

Formula

FormulaDescription (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

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

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 instead of just a non-descript "0" you want something more informative, do something like:

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

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

thanks very much