how do I write a formula if b2 is less than a2 then subtract

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm looking for a formula that says if b2 is less than a2 then subtract but
if greater than then add
Thanks
 
Try:

=IF(B2<A2,A2-B2,A2+B2)

although you didn't specify what to do when A2=B2. this formula would add
A2 and B2 when they are equal.
 
I'm looking for a formula that says if b2 is less than a2 then subtract

Ok, subtract what? B2 from A2?

Also, you didn't say what to do if A2 = B2.

=IF(B2<A2,A2-B2,A2+B2)

If A2 = B2 they will be added.
 
Back
Top