Formula: Simple but complex for me

BillV

New Member
Joined
Jun 19, 2003
Messages
38
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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
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
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
You should be able to do it in one cell:

=IF(OR(ABS(B26-B30)<59,ABS(B26-B30)>300),"OK","ALERT")
 
Upvote 0
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
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,214,840
Messages
6,121,895
Members
449,058
Latest member
Guy Boot

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
Back
Top