Formula: Simple but complex for me

BillV

New Member
Joined
Jun 19, 2003
Messages
26
Can someone help me build a formula that will do this:

Always subtract the smaller number from the larger number
IF B26 is greater than B30 then subtract B30 from B26
IF B30 is greater than B26 then subtract B26 from B30
If the result is less than 59 OK
If the result is greater than 300 OK
Anything else ALERT
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

dialup

Board Regular
Joined
Jan 10, 2008
Messages
99
try

=IF(B26-B30 > 0,B26-B30 ,B30-B26)

sorry only read the 1st bit - i'll look at the second criteria
 
Last edited:
Upvote 0

jerel1429

New Member
Joined
Sep 24, 2008
Messages
20
You might need two cells to do this. Try this:

In cell B32: =IF(B26>B30,B26-B30,B30-B26)
In cell B33: =IF(OR(B32<59,B32>300)=TRUE,"OK","ALERT")
 
Upvote 0

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,961
Office Version
  1. 365
Platform
  1. Windows
You should be able to do it in one cell:

=IF(OR(ABS(B26-B30)<59,ABS(B26-B30)>300),"OK","ALERT")
 
Upvote 0

dialup

Board Regular
Joined
Jan 10, 2008
Messages
99
this works put it in any cell

=IF(IF(B26-B30 > 0,B26-B30,B30-B26) <59,IF(B26-B30 > 0,B26-B30,B30-B26),IF(IF(B26-B30 > 0,B26-B30,B30-B26) >300,IF(B26-B30 > 0,B26-B30,B30-B26),"ALERT"))
 
Upvote 0

BillV

New Member
Joined
Jun 19, 2003
Messages
26
Each of these formula's seem to be close. I probably didn't provide the best explanation. Hotpepper's formula is more of what I expected. I need to do more testing. I'll come back if I need additional help. Thanks to everyone!
 
Upvote 0

Forum statistics

Threads
1,191,197
Messages
5,985,231
Members
439,951
Latest member
flamingogaslight

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top