# IF Value can be divided by..

#### Browneh89

##### Board Regular
Hello,

I am attempting to write an IF statement where it looks at 2 cells and if either cell can be divisible by 4 (4/8/12/16 etc..) the result will show as "0" However if both of the values added together equal a divisible of 4 it shows as "1"

=IF(D2=8,0,IF(E2=8,0,IF((D2+E2)=8,1,0)))

So for example below

Is this even possible?

### Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

#### jasonb75

##### Well-known Member
You can do that with
Excel Formula:
``=SIGN(MOD(D2,4))``

edit:- reading your post a second time, I think you might need
Excel Formula:
``=IF(OR(MOD(D2:E2,4))=0,0,IF(MOD(D2+E2,4)=0,1,"oops"))``
If you don't have an up to date version of office 365 (with dynamic arrays) then you will need to array confirm the formula with Ctrl Shift Enter.

#### Browneh89

##### Board Regular
You can do that with
Excel Formula:
``=SIGN(MOD(D2,4))``

edit:- reading your post a second time, I think you might need
Excel Formula:
``=IF(OR(MOD(D2:E2,4))=0,0,IF(MOD(D2+E2,4)=0,1,"oops"))``
If you don't have an up to date version of office 365 (with dynamic arrays) then you will need to array confirm the formula with Ctrl Shift Enter.
Thank you for your response Jason,

I have applied your formula with the MOD function however it still does not return the results I was looking for

Below is what it shows, perhaps I did not explain myself well.

#### Attachments

• 1613410924002.png
6 KB · Views: 1

#### jasonb75

##### Well-known Member
I had parenthesis in the wrong place, I've corrected that and it looks like it works fine now.
Book1
DEF
2040
3800
4440
5621
Sheet1
Cell Formulas
RangeFormula
F2:F5F2=IF(OR(MOD(D2:E2,4)=0),0,IF(MOD(D2+E2,4)=0,1,"oops"))

#### Browneh89

##### Board Regular
I had parenthesis in the wrong place, I've corrected that and it looks like it works fine now.
Book1
DEF
2040
3800
4440
5621
Sheet1
Cell Formulas
RangeFormula
F2:F5F2=IF(OR(MOD(D2:E2,4)=0),0,IF(MOD(D2+E2,4)=0,1,"oops"))
Yes! this works fantastically Thank you!

Replies
1
Views
71
Replies
0
Views
73
Replies
2
Views
264
Replies
0
Views
66
Replies
3
Views
160

1,127,872
Messages
5,627,393
Members
416,245
Latest member
Xterminat

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