Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / August 2006

Tip: Looking for answers? Try searching our database.

This Year

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
simserob - 19 Aug 2006 21:08 GMT
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?

Signature

simserob

Trevor Shuttleworth - 19 Aug 2006 21:26 GMT
Something like:

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

Regards

Trevor

> Hi, is there a way to program with the date function this year?
>
[quoted text clipped - 5 lines]
> but how would you get it to work for this year, and so it would reset
> itself every January 1st?
simserob - 20 Aug 2006 02:26 GMT
thanks a lo
simserob - 20 Aug 2006 02:34 GMT
btw, if you feel like it, i'd appreciate it if you explained what th
whole "DATE(YEAR(TODAY()),1,1)" is about, i don't really understand ho
it's working and i just think it might help me in the future if
understood the logic.

thanks agai
Trevor Shuttleworth - 20 Aug 2006 08:42 GMT
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

> 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 - 20 Aug 2006 17:19 GMT
i get it now
thanks a lo
VBA Noob - 19 Aug 2006 21:27 GMT
Sometime like

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

VBA Noo
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.