How would I write this in Excel formula?

C1 = A1-A2 if A1 is less than A2.

First time here? Check out the FAQ!

x

+2 votes

The formula for the C1 cell should look like this:

*=if(A1<A2, A1-A2, 0)*

The third value in the 'if' statement (in this case, a zero) is the value that is returned if the condition is not met. In general terms, the syntax is this: =if(condition, value if true, value if false).

0 votes

Here the value in C1 is as follws:

*=IF(A1<A2, A1-A2, 0)*

The third value in the 'IF' statement (here 0) is the value that is returned if the condition is not met. Thus the Syntax would be: "=IF(Condition, Value if true, Value if false)".

You can get these formulas & their synatx, if you type "SHIFT+F3", & then the relevant formula is choosen.

...