Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Excel Formula

Oct 18, 2007 4:49AM PDT

I haven't been able to find a way to display the year in Excel. (Its office 2003)

I want it to display just the year, not any other thing (such as the month or day)

Any help would be appreciated

Discussion is locked

- Collapse -
YEAR(A2)
Oct 18, 2007 6:02AM PDT

If a date is entered into A2, eg 10/17/2007, then in A3 type =YEAR(A2)

However, the date in A2 must be entered in DATE format, ie use =DATE(2007,10,17)

This will display 2007 in A3.

Awkward but can be used. I don't know if others have easier solutions.

I hope that helps

Mark

- Collapse -
Thanks alot
Oct 18, 2007 6:15AM PDT

Thanks alot Mark - thats really helpful!
It worked, which is a bit of a relief after days of trying to make it work

Cheers

- Collapse -
"days of trying"
Oct 18, 2007 9:06PM PDT

A few posts below, I post 2 simple solutions. Just one formula, one of them combines with a custom formatting. That's basic use of Excel. Nothing difficult or advanced.

Sometimes, it pays off to invest time in study, education, books and courses. I'm sure working through a 3-days Excel course would have learned you not only this, but quite a lot of useful other things, so it would save you a tremendous amount of time in the future.

Just a suggestion.

Kees

- Collapse -
Re: date format
Oct 18, 2007 8:05AM PDT

Sorry, your requirements are far from clear. To display 2007, just enter 2007. It's uncommon (to say the least) to enter 11/23/2007 (American date format) in a cell and wanting to see only the 2007 part. It's easily possible (by using the date format yyyy, in stead of the more usual m/d/yy or mm/dd/yyyy), but uncommon.

So I assume you want to enter a date in a cell (like B1) and show the year in another cell (like C1). Then indeed, the formula is =year(B1). The way you enter the date in B1 isn't important at all, as long as Excel understands or knows it's a date. De DATE-formula used by Mark is rather clumsy. Just entering it as 11/23/2007 works just as well.

Hope this helps.


Kees

- Collapse -
Ooops
Oct 18, 2007 4:42PM PDT

Sorry if its unclear - but what i meant was i needed to display the current year (so it would be 2007 if you checked this year and 2008 if you checked it next year). I can display the current date now, and frm that i can get the current year now Happy

- Collapse -
The two possibilities for that:
Oct 18, 2007 6:42PM PDT

1. =year(now()) - with nested function
2. =now, with the field formatted as yyyy

Your choice.

Kees

- Collapse -
Now that's weird.
Oct 18, 2007 6:42PM PDT

I use Excel 2002, (XP).

When I tried this out, eg a date in European format such as 17/10/2007 in A1, and entered =Year(A1) in A2, all I got was a cell with numbers, (possibly Julian format?).

That confused me as I am sure I've used Year(cellref) before. When I checked Help it told me that I had to use =Date(yy,dd,mm) format for this to work.

However, I have just tried it again (all that was yesterday and now is today), and it worked as normal.

I knew I had done this before!

It must have been me! Happy

Mark