Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Referencing year portion of date

Excel 2003 SP2
Win XP SP3

I want to compare today's year with a 4-digit number to see if they are the
same.

I tried formatting a cell as "yyyy" and then using =now(). This DISPLAYS
the year, but if I try to compare it to the number I get a mismatch.

Ultimately, I want to display "Updated" in a cell, if today's year is the
same as the 4-digit number in the reference sheet.

I'd prefer a formula over VBA code, but beggars can't be choosers, right? =)

I'd appreciate any pointers to get me started in the right direction. Thank
you.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Referencing year portion of date

=if(year(today()=a1,"same year","different years")



Allison wrote:

Excel 2003 SP2
Win XP SP3

I want to compare today's year with a 4-digit number to see if they are the
same.

I tried formatting a cell as "yyyy" and then using =now(). This DISPLAYS
the year, but if I try to compare it to the number I get a mismatch.

Ultimately, I want to display "Updated" in a cell, if today's year is the
same as the 4-digit number in the reference sheet.

I'd prefer a formula over VBA code, but beggars can't be choosers, right? =)

I'd appreciate any pointers to get me started in the right direction. Thank
you.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Referencing year portion of date

A B
1 3/1/2005 =year(A1)=A$5 False
2 10/5/2008 True
3 4/9/2003 False
4
5 2008

Enter the formula shown in cell B1 and copied it down.
It will evaluate as shown.

Art
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Referencing year portion of date

Exactly what I wanted. Thank you.

"Dave Peterson" wrote:

=if(year(today()=a1,"same year","different years")



Allison wrote:

Excel 2003 SP2
Win XP SP3

I want to compare today's year with a 4-digit number to see if they are the
same.

I tried formatting a cell as "yyyy" and then using =now(). This DISPLAYS
the year, but if I try to compare it to the number I get a mismatch.

Ultimately, I want to display "Updated" in a cell, if today's year is the
same as the 4-digit number in the reference sheet.

I'd prefer a formula over VBA code, but beggars can't be choosers, right? =)

I'd appreciate any pointers to get me started in the right direction. Thank
you.


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Referencing year portion of date

Thank you.

"ArthurJ" wrote:

A B
1 3/1/2005 =year(A1)=A$5 False
2 10/5/2008 True
3 4/9/2003 False
4
5 2008

Enter the formula shown in cell B1 and copied it down.
It will evaluate as shown.

Art

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove time portion from date on Excel 2007 chart NeoFax Charts and Charting in Excel 1 September 4th 09 02:43 AM
Determine year over year date for comparison zeroscou Excel Worksheet Functions 3 March 6th 09 10:01 PM
How do I add a portion of a day to a date? notanexcelguru Excel Worksheet Functions 2 May 2nd 08 05:52 PM
Matching the month and year portion of a date only RGB Excel Discussion (Misc queries) 1 June 9th 06 05:43 PM
Buttons in lower portion of workbook appear in upper portion ToferKing Excel Programming 1 April 22nd 06 06:46 PM


All times are GMT +1. The time now is 05:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"