If statement using current year

MelanieB
3StarLounger
Posts: 310
Joined: 19 Apr 2010, 16:18
Location: middle of the state of Washington

If statement using current year

Post by MelanieB »

Column B is a list of years (ex: 1998, 2001, 2001, 2010).
In column F, I want to write an if statement that says if the value in column B is less than the current year, then return the value of 1, otherwise return a zero.

I'm stuck.. I know how to do that using Today(), but is there something like that for looking at the current system date and using just the year?

I tried this in F2:
=IF(B2<TODAY(),1,0)

but it returns a 1 when the year 2010 is in column B, and in that case I want the value of 0.

User avatar
Argus
GoldLounger
Posts: 3081
Joined: 24 Jan 2010, 19:07

Re: If statement using current year

Post by Argus »

It's quite late over here, :nosleep: but how about:
=IF(B2<YEAR(TODAY()),1,0)
(Year returns the year corresponding to a date.)
Byelingual    When you speak two languages but start losing vocabulary in both of them.

User avatar
sdckapr
3StarLounger
Posts: 392
Joined: 25 Jan 2010, 12:21

Re: If statement using current year

Post by sdckapr »

=IF(B2<year(TODAY()),1,0)

Steve

User avatar
HansV
Administrator
Posts: 78490
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: If statement using current year

Post by HansV »

Or even

=1*(B2<YEAR(TODAY()))
Best wishes,
Hans

MelanieB
3StarLounger
Posts: 310
Joined: 19 Apr 2010, 16:18
Location: middle of the state of Washington

Re: If statement using current year

Post by MelanieB »

That worked perfectly! Thank you.