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

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
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,223,306
Messages
6,171,322
Members
452,396
Latest member
ajl_ahmed

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