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

=?Utf-8?B?ZGVsZXRlIGF1dG9tYXRpY2FsbHk=?=
Guest
Posts: n/a

 2nd Oct 2007
I'm looking for a formula that says if b2 is less than a2 then subtract but
Thanks

=?Utf-8?B?Sk1C?=
Guest
Posts: n/a

 2nd Oct 2007
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.

"delete automatically" wrote:

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

Trevor Shuttleworth
Guest
Posts: n/a

 2nd Oct 2007
Not sure I understand but ...

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

Regards

Trevor

"delete automatically" <(E-Mail Removed)> wrote
in message news:8088169D-9B29-483F-8B0B-(E-Mail Removed)...
> I'm looking for a formula that says if b2 is less than a2 then subtract
> but
> if greater than then add
> Thanks

T. Valko
Guest
Posts: n/a

 2nd Oct 2007
> 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.

--
Biff
Microsoft Excel MVP

"delete automatically" <(E-Mail Removed)> wrote
in message news:8088169D-9B29-483F-8B0B-(E-Mail Removed)...
> I'm looking for a formula that says if b2 is less than a2 then subtract
> but
> if greater than then add
> Thanks

 Thread Tools Rate This Thread Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Crowbar via OfficeKB.com Microsoft Excel Programming 3 24th Oct 2005 09:33 PM =?Utf-8?B?Y29hbF9taW5lcg==?= Microsoft Excel Worksheet Functions 3 4th May 2005 03:57 PM Doug Security and Anti-Spyware Community 0 13th Jan 2005 01:29 PM DarrenM Spyware Discussion 3 7th Jan 2005 06:32 PM =?Utf-8?B?QmF6MQ==?= Microsoft Excel Worksheet Functions 1 30th Nov 2004 05:33 PM

Features