Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default how do I write a formula if b2 is less than a2 then subtract

I'm looking for a formula that says if b2 is less than a2 then subtract but
if greater than then add
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default how do I write a formula if b2 is less than a2 then subtract

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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,089
Default how do I write a formula if b2 is less than a2 then subtract

Not sure I understand but ...

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

Regards

Trevor


"delete automatically" wrote
in message ...
I'm looking for a formula that says if b2 is less than a2 then subtract
but
if greater than then add
Thanks



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default how do I write a formula if b2 is less than a2 then subtract

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" wrote
in message ...
I'm looking for a formula that says if b2 is less than a2 then subtract
but
if greater than then add
Thanks



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I write a fromula to subtract 1/4 from 1/2 and so on? Excell novice Excel Discussion (Misc queries) 5 September 17th 06 12:41 AM
formula to subtract time, 12:10 am (00:10) - 11:50 pm (23:10) ? teezee New Users to Excel 1 January 8th 06 11:11 PM
I would like to know how to enter the formula that would subtract. bil391 Excel Worksheet Functions 3 January 30th 05 01:13 AM
How do I create a formula that would allow me to subtract from a d Justlearning New Users to Excel 5 January 27th 05 09:47 PM
How do I write a formula to subtract a # from a total ONLY if the. JP Excel Worksheet Functions 2 November 17th 04 12:32 AM


All times are GMT +1. The time now is 05:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"