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.

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,713
Office Version
  1. 365
Platform
  1. Windows
Something like:

=IF(AND(MONTH(B1)=1,ISEVEN(YEAR(B1))),x,0)
 

ghrain22

Active Member
Joined
Jan 9, 2014
Messages
473
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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,484
Messages
5,831,933
Members
430,094
Latest member
soconfused365

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