Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Remove time portion from date on Excel 2007 chart | Charts and Charting in Excel | |||
Determine year over year date for comparison | Excel Worksheet Functions | |||
How do I add a portion of a day to a date? | Excel Worksheet Functions | |||
Matching the month and year portion of a date only | Excel Discussion (Misc queries) | |||
Buttons in lower portion of workbook appear in upper portion | Excel Programming |