If statement help

IrishHawg09

New Member
Joined
Sep 9, 2014
Messages
16
Hello,

I'm trying to create an if statement that returns every other January. My current statement is "=IF(month(B1)=1,x,0)". This obviously returns a value every January, but as stated I only want every other January. Can this be done simply?

Thanks!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
For Even Years:
=IF(AND(MONTH(B1)=1,MOD(YEAR(B1),2)=0),x,0)

For Odd Years:
=IF(AND(MONTH(B1)=1,MOD(YEAR(B1),2)=1),x,0)

Using the mod function you can look at the remainder of a division problem. So basically look to see if the year divided by 2 has a remainder of not.
 
Upvote 0

Forum statistics

Threads
1,215,447
Messages
6,124,906
Members
449,194
Latest member
JayEggleton

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