IF Value can be divided by..

Browneh89

Board Regular
Joined
Mar 8, 2019
Messages
55
Office Version
  1. 365
Platform
  1. Windows
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

1613408816574.png


Is this even possible?
 

Some videos you may like

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
12,459
Office Version
  1. 365
Platform
  1. Windows
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
Joined
Mar 8, 2019
Messages
55
Office Version
  1. 365
Platform
  1. Windows
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.

1613411011184.png
 

Attachments

  • 1613410924002.png
    1613410924002.png
    6 KB · Views: 1

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
12,459
Office Version
  1. 365
Platform
  1. Windows
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"))
 
Solution

Browneh89

Board Regular
Joined
Mar 8, 2019
Messages
55
Office Version
  1. 365
Platform
  1. Windows
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!
 

Watch MrExcel Video

Forum statistics

Threads
1,127,606
Messages
5,625,767
Members
416,136
Latest member
senthil_sk

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
Top