ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   make negative number value to zero (https://www.excelbanter.com/excel-worksheet-functions/37465-make-negative-number-value-zero.html)

india0693

make negative number value to zero
 

when I enter that function in cell A3....it gave me the wrong answer.
In cell A3, it gave me (3) as the answer.....I used this formula:

If your numbers are in A1=3 to A2=8,
=IF(A1<0,0,A1)

-I am looking for a way to calculate only zero instead of going below
0.-

example:

3
8
-5 (instead of -5, I am looking for a way to make it calculate to the
number zero)

However, if switch around the correct answer will be positive 5...

???But how do I make the answer show the number zero if it becomes
(-5)????


--
india0693
------------------------------------------------------------------------
india0693's Profile: http://www.excelforum.com/member.php...o&userid=25663
View this thread: http://www.excelforum.com/showthread...hreadid=390811


Adrian M

Besides using an IF statement you can also use a MAX statement so for example
you would say =MAX(-5,0) and Excel would show the maximum of the 2 numbers
which in this case would be 0. If it was =MAX(5,0) then it would show a 5.
You can replace the numbers with cell references as well. Look on
http://www.auditexcel.co.za/statistics.html to see how to use the MIN and MAX
features.

"india0693" wrote:


when I enter that function in cell A3....it gave me the wrong answer.
In cell A3, it gave me (3) as the answer.....I used this formula:

If your numbers are in A1=3 to A2=8,
=IF(A1<0,0,A1)

-I am looking for a way to calculate only zero instead of going below
0.-

example:

3
8
-5 (instead of -5, I am looking for a way to make it calculate to the
number zero)

However, if switch around the correct answer will be positive 5...

???But how do I make the answer show the number zero if it becomes
(-5)????


--
india0693
------------------------------------------------------------------------
india0693's Profile: http://www.excelforum.com/member.php...o&userid=25663
View this thread: http://www.excelforum.com/showthread...hreadid=390811



Roger Govier

As Max said, but inserting your example
=MAX(0,SUM(A1:A2))

--
Regards
Roger Govier
"india0693" wrote
in message ...

when I enter that function in cell A3....it gave me the wrong answer.
In cell A3, it gave me (3) as the answer.....I used this formula:

If your numbers are in A1=3 to A2=8,
=IF(A1<0,0,A1)

-I am looking for a way to calculate only zero instead of going below
0.-

example:

3
8
-5 (instead of -5, I am looking for a way to make it calculate to the
number zero)

However, if switch around the correct answer will be positive 5...

???But how do I make the answer show the number zero if it becomes
(-5)????


--
india0693
------------------------------------------------------------------------
india0693's Profile:
http://www.excelforum.com/member.php...o&userid=25663
View this thread: http://www.excelforum.com/showthread...hreadid=390811





All times are GMT +1. The time now is 09:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com