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?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
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.
 
Upvote 0
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
Upvote 0
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"))
 
Upvote 0
Solution
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!
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

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