#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default This Year


Hi, is there a way to program with the date function this year?

For example if I wanted to say something like "Days Past in this Year"
or something (sorry for the weak example), and I wanted to link
everything back to January 1st of this year, I would say
=today()-date(this year,1,1)

but how would you get it to work for this year, and so it would reset
itself every January 1st?


--
simserob
------------------------------------------------------------------------
simserob's Profile: http://www.excelforum.com/member.php...o&userid=36635
View this thread: http://www.excelforum.com/showthread...hreadid=573452

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,089
Default This Year

Something like:

=TODAY()-DATE(YEAR(TODAY()),1,1)

Regards

Trevor


"simserob" wrote in
message ...

Hi, is there a way to program with the date function this year?

For example if I wanted to say something like "Days Past in this Year"
or something (sorry for the weak example), and I wanted to link
everything back to January 1st of this year, I would say
=today()-date(this year,1,1)

but how would you get it to work for this year, and so it would reset
itself every January 1st?


--
simserob
------------------------------------------------------------------------
simserob's Profile:
http://www.excelforum.com/member.php...o&userid=36635
View this thread: http://www.excelforum.com/showthread...hreadid=573452



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default This Year


Sometime like

=TODAY()-DATE(YEAR(TODAY()),1,1)+1&" Days Past in this Year"

VBA Noob


--
VBA Noob
------------------------------------------------------------------------
VBA Noob's Profile: http://www.excelforum.com/member.php...o&userid=33833
View this thread: http://www.excelforum.com/showthread...hreadid=573452

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default This Year


thanks a lot


--
simserob
------------------------------------------------------------------------
simserob's Profile: http://www.excelforum.com/member.php...o&userid=36635
View this thread: http://www.excelforum.com/showthread...hreadid=573452

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default This Year


btw, if you feel like it, i'd appreciate it if you explained what the
whole "DATE(YEAR(TODAY()),1,1)" is about, i don't really understand how
it's working and i just think it might help me in the future if i
understood the logic.

thanks again


--
simserob
------------------------------------------------------------------------
simserob's Profile: http://www.excelforum.com/member.php...o&userid=36635
View this thread: http://www.excelforum.com/showthread...hreadid=573452



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,089
Default This Year

The easiest way to understand it is to build it up in separate cells, step
by step, so you can see what values you get.

=TODAY() gives you today's date, so right now, 20/08/2006 (dd/mm/yyy)
=YEAR(TODAY()) gives you the year from today's date, so 2006
=DATE(YEAR(TODAY()),1,1) gives a date value using this year, month 1 and day
1, that is, 01/01/2006

If you were to format the cell as General or as Number you'd see that this
is 38718, the number of days since 01/01/1900

The numeric value for Today's date is 38949.

Hence you can use those values to calculate the number of days between two
dates, etc.

Regards

Trevor


"simserob" wrote in
message ...

btw, if you feel like it, i'd appreciate it if you explained what the
whole "DATE(YEAR(TODAY()),1,1)" is about, i don't really understand how
it's working and i just think it might help me in the future if i
understood the logic.

thanks again


--
simserob
------------------------------------------------------------------------
simserob's Profile:
http://www.excelforum.com/member.php...o&userid=36635
View this thread: http://www.excelforum.com/showthread...hreadid=573452



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default This Year


i get it now
thanks a lot


--
simserob
------------------------------------------------------------------------
simserob's Profile: http://www.excelforum.com/member.php...o&userid=36635
View this thread: http://www.excelforum.com/showthread...hreadid=573452

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
Graphing-Two stacked columns side-by-side per year brwneyeirishlady Charts and Charting in Excel 1 July 30th 06 08:18 PM
Vacation Time calculation... HELP! brubru Excel Discussion (Misc queries) 1 July 22nd 06 10:10 PM
Lookup returns wrong value motorjobs Excel Worksheet Functions 5 June 21st 06 11:49 PM
holiday dates bucci Excel Worksheet Functions 4 June 15th 06 09:35 AM
How do I get Excel to automatically calculate salaries actually received in financial year? Kei Excel Discussion (Misc queries) 0 March 3rd 06 10:26 AM


All times are GMT +1. The time now is 06:41 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"