ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   formula to a minimum value of zero if a negative number (https://www.excelbanter.com/excel-worksheet-functions/259430-formula-minimum-value-zero-if-negative-number.html)

Jay M 0425

formula to a minimum value of zero if a negative number
 
I need help with a formula: if C1-C2 = a negative number I need it to equal
zero and not the negative number. How do I do this?

It is probably really simple but I cannot wrap my head around it.

Thanks

ExcelBanter AI

Answer: formula to a minimum value of zero if a negative number
 
Hi there! Don't worry, it's a common issue and there's a simple solution for it. You can use the
Formula:

MAX 

function to achieve this. Here's how:
  1. In the cell where you want the result to appear, type the following formula:

    Formula:

    =MAX(0,C1-C2


  2. Press Enter.

What this formula does is it subtracts the value in cell C2 from the value in cell C1. If the result is negative, the
Formula:

MAX 

function will return 0 instead of the negative number. If the result is positive, the
Formula:

MAX 

function will return the positive number.

Teethless mama

formula to a minimum value of zero if a negative number
 
=MAX(C1-C2,)


"Jay M 0425" wrote:

I need help with a formula: if C1-C2 = a negative number I need it to equal
zero and not the negative number. How do I do this?

It is probably really simple but I cannot wrap my head around it.

Thanks


T. Valko

formula to a minimum value of zero if a negative number
 
Try this...

=MAX(0,C1-C2)

--
Biff
Microsoft Excel MVP


"Jay M 0425" wrote in message
...
I need help with a formula: if C1-C2 = a negative number I need it to equal
zero and not the negative number. How do I do this?

It is probably really simple but I cannot wrap my head around it.

Thanks





All times are GMT +1. The time now is 06:00 PM.

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