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!
 

Some videos you may like

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,110
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,108,787
Messages
5,524,877
Members
409,609
Latest member
Channingz

This Week's Hot Topics

Top