Using IF AND

Nanaia

Active Member
Joined
Jan 11, 2018
Messages
306
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I'm trying to create a warning formula to tell me if C2 is within 2.25 of the value of A2 divided by 2. I think it will be an IF AND combination but could be wrong. To explain further here is an example; if A2 is 110 and C2 is any number equal to or between 52.75 and 57.25; basically if C2 equals (A2/2)+ or - 2.25 then I want this formula to flag with the word ALERT or something similar. The value in A2 and C2 will vary but the + or - 2.25 will never vary.
Thank you.
 
Last edited:

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hello, If I understand, I think this:

Code:
=IF(OR(C2>(A2/2)+2.25,C2<(A2/2)-2.25),"ALERT","")[/COLOR][/SIZE][/FONT]
 
Last edited:
Upvote 0
That's an excellent start! Thanks!

Next spin on the same formula is whether there is an easy (relatively speaking) formula to add to the above if C2 is always in feet & inches (i.e. 2'-11 5/8") an A2 is always a decimal. The above formula gives an alert every time C2 has any value in it, even if its value is outside the +-2.25.
 
Upvote 0
2'-11 5/8" is a text value due to the quote/quotes.
You cant perform mathematical operations on text that contains quotes, it will need to be converted

Solution to original problem

=IF(ABS(C2-A2/2)<=2.25<"ALERT","")
 
Last edited:
Upvote 0
I'm unable to get the ABS to work. When tested with a number that should cause an alert, it doesn't "alert".

I added a conversion column to resolve the FT-IN to inches only. The ALERT still does not work though. When I use Joyner's formula it alerts for every C2 entry regardless of the value, when I use Special-K99's ABS formula it doesn't alert to any value in C2, even if the value should cause an alert.
 
Last edited:
Upvote 0
Thank you. I thought I caught it but had simply removed the < instead of replacing it with a comma.
It appears to be working now. Thank you again for your help!
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,320
Members
452,635
Latest member
laura12345

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