# If statement getting out of hand

#### dsdavis6

##### New Member
Hi,

I am trying to come up with a formula that does a couple of sums from cells, and if its more than .26 or less than -.26 displays one thing and anything in the middle displays another. This is my attempt but I can't see quite what is wrong with it. Any help would be greatly appreciated.

IF(AND(IF(K2="Home",AA2-AB2+L2,AB2-AA2+L2)>0.25,(IF(K2="Home",AA2-AB2+L2,AB2-AA2+L2)<-.25,"full","void")))

### Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

#### jaybee3

##### Active Member
Hi there,

You need to check to see if it's either greater than 0.25 or less than -0.25, so you'll need an OR not and AND.

Code:
``=if(or(  (if(K2="Home",AA2-AB2+L2,AB2-AA2+L2) > 0.25), (if(K2="Home",AA2-AB2+l2,AB2-AA2+L2)<-0.25)), "Full",Void)``

I'm sure it can be rewritten more succinctly but that should do the trick. (Untested)

#### dsdavis6

##### New Member
Hi there,

You need to check to see if it's either greater than 0.25 or less than -0.25, so you'll need an OR not and AND.

Code:
``=if(or(  (if(K2="Home",AA2-AB2+L2,AB2-AA2+L2) > 0.25), (if(K2="Home",AA2-AB2+l2,AB2-AA2+L2)<-0.25)), "Full",Void)``

I'm sure it can be rewritten more succinctly but that should do the trick. (Untested)

That has worked. Thank you very much!

Replies
6
Views
6K
Replies
25
Views
781
Replies
2
Views
313
Replies
0
Views
144
Replies
6
Views
2K

1,195,635
Messages
6,010,834
Members
441,569
Latest member
PeggyLee

### 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.

### Which adblocker are you using?

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

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