Link to home
Start Free TrialLog in
Avatar of maqskywalker
maqskywalker

asked on

excel if statement syntax

Hi experts,

I'm using Excel 2013.

Today’s date is 9/29/2016

In excel the following formula gives me the month part of today’s date. So it gives me 9.
=MONTH(TODAY())

In excel the following formula gives me the year part of today’s date. So it gives me 2016
=YEAR(TODAY())

In excel the syntax for an if statement is like this

=IF(statement,ifstatementistruedothis,ifstatementisfalsedothis)


I'm working on an if statement.
This is the logic for the if statement I need.

If the month part of today’s date equals 1,2,3,4,5,6
           then set the year to 2016
Else  If the month part of today’s date equals 7,8,9,10,11,12
          then set the year to 2017

So far this is what I have. In the part where i put xxx that's the part I need help with.

=IF(xxx=xxx,2016,2017)

Anyone the syntax for the if statement mentioned above?
ASKER CERTIFIED SOLUTION
Avatar of Glenn Ray
Glenn Ray
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of maqskywalker
maqskywalker

ASKER

thanks
thanks