ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   YEAR and IF (https://www.excelbanter.com/excel-worksheet-functions/172321-year-if.html)

PAL

YEAR and IF
 
I am trying a conditional statement to return "yes" if the date is in 2005.
I have used this

=IF(M2=YEAR(2005),"yes","") or =IF(M2=YEAR(AA2),"yes",""). The second
statement reference a cell w/ the year. I do not get any field to be "yes"
which I know is wrong.

Please advise.

Eventually I will want to use "OR" which will look for 2005 in multiple
columns. Thanks.

Pete_UK

YEAR and IF
 
If M2 contains a date, I think you need something like this:

=IF(YEAR(M2)=2005,"yes","")

Hope this helps.

Pete

On Jan 9, 2:42*pm, PAL wrote:
I am trying a conditional statement to return "yes" if the date is in 2005.. *
I have used this

=IF(M2=YEAR(2005),"yes","") or =IF(M2=YEAR(AA2),"yes",""). *The second
statement reference a cell w/ the year. *I do not get any field to be "yes"
which I know is wrong.

Please advise.

Eventually I will want to use "OR" which will look for 2005 in multiple
columns. *Thanks.



Mike H

YEAR and IF
 
Maybe

=IF(YEAR(A1)=2005,"Y","N")

Mike

"PAL" wrote:

I am trying a conditional statement to return "yes" if the date is in 2005.
I have used this

=IF(M2=YEAR(2005),"yes","") or =IF(M2=YEAR(AA2),"yes",""). The second
statement reference a cell w/ the year. I do not get any field to be "yes"
which I know is wrong.

Please advise.

Eventually I will want to use "OR" which will look for 2005 in multiple
columns. Thanks.



All times are GMT +1. The time now is 04:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com