# Help with IF AND OR

• 03-21-2019, 05:51 PM
DINODIVER
Help with IF AND OR
I'm really new at all of this and I've been racking my brain for a while on this. To no avail, I am coming up with errors.

Here's what I'm trying to do:

I need to get a cell to read "Flammable" only under these conditions:

“FLAMMABLE” ONLY IF B22 > 1000, but < 8820

AND

“FLAMMABLE” ONLY WHEN B22 is >8820 AND THERE ARE VALUES GREATER THAN 0 in ANY of the following boxes: C22,E22:G22,I22,K22,M22,N22

Any help would be greatly appreciated!
• 03-21-2019, 06:18 PM
TMS
Re: Help with IF AND OR
Try:
Formula:
```=IF(AND( B22 > 1000, B22 < 8820), "FLAMMABLE", "")
```
• 03-21-2019, 06:21 PM
mehmetcik
Re: Help with IF AND OR
=IF(or(AND( B22 > 1000, B22 < 8820), and(sum(B22 > 8820, C22,E22:G22,I22,K22,M22,N22)>0)), "FLAMMABLE", "")
• 03-21-2019, 06:51 PM
GeoffW283
Re: Help with IF AND OR
I'm confused, but that's fine - ignore me if the following makes no sense.

For the sake of the following discussion:
Expression-1 =
“FLAMMABLE” ONLY IF B22 > 1000, but < 8820

Expression-2 =
“FLAMMABLE” ONLY WHEN B22 is >8820 AND THERE ARE VALUES GREATER THAN 0 in ANY of the following boxes: C22,E22:G22,I22,K22,M22,N22

The required result is Expression-1 AND Expression-2

If B22>= 8820 then Expression-1 is FALSE and so the whole expression is FALSE

If B22 < 8820 then Expression-2 is FALSE and so the whole expression is FALSE.

So in summary we should never get Flammable = TRUE
• 05-15-2019, 03:37 PM
DINODIVER
Re: Help with IF AND OR
This worked perfectly mehmetcik , thank you so much.