Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Excel Date Formula Question


Cactus1993:

Try this

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

Matt


--
Flintstone
------------------------------------------------------------------------
Flintstone's Profile: http://www.excelforum.com/member.php...o&userid=15310
View this thread: http://www.excelforum.com/showthread...hreadid=566337

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Excel Date Formula Question

Although this formula works, it may not be the most efficient:

=A1-(A1-DATE(YEAR(A1),1,1))
is the same as:
=A1-A1+DATE(YEAR(A1),1,1))
or
=DATE(YEAR(A1),1,1)



Flintstone wrote:

Cactus1993:

Try this

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

Matt

--
Flintstone
------------------------------------------------------------------------
Flintstone's Profile: http://www.excelforum.com/member.php...o&userid=15310
View this thread: http://www.excelforum.com/showthread...hreadid=566337


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Excel Date Formula Question

Thanks again ... I appreciate the help.


Dave Peterson wrote:
Although this formula works, it may not be the most efficient:

=A1-(A1-DATE(YEAR(A1),1,1))
is the same as:
=A1-A1+DATE(YEAR(A1),1,1))
or
=DATE(YEAR(A1),1,1)



Flintstone wrote:

Cactus1993:

Try this

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

Matt

--
Flintstone
------------------------------------------------------------------------
Flintstone's Profile: http://www.excelforum.com/member.php...o&userid=15310
View this thread: http://www.excelforum.com/showthread...hreadid=566337


--

Dave Peterson


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,327
Default Excel Date Formula Question

If we take efficiency to the extremes; any formula solution will recalculate
on every new cell entry in the workbook, while this job has to be done only
once a year. I'd put a small macro solution in the workbook_open event to
check which year it is and hardcode that proper new year date into the cell,
unless it's a very lightweight workbook that is.

Best wishes Harald

"Dave Peterson" skrev i melding
...
Although this formula works, it may not be the most efficient:



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Excel Date Formula Question

Or even just type the date in on January 1st each year.

Harald Staff wrote:

If we take efficiency to the extremes; any formula solution will recalculate
on every new cell entry in the workbook, while this job has to be done only
once a year. I'd put a small macro solution in the workbook_open event to
check which year it is and hardcode that proper new year date into the cell,
unless it's a very lightweight workbook that is.

Best wishes Harald

"Dave Peterson" skrev i melding
...
Although this formula works, it may not be the most efficient:


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Excel Date Formula Question

I wanted to fully automate a financial analysis workbook with several
tabs to calculate YTD returns, YTD % returns, and other YTD
calculations -- using the difference between the current date and the
first day of that current year, as a denominator. Full automation is
the reason I needed this formula. (Didn't want you to think I was just
being lazy. :-))


Dave Peterson wrote:
Or even just type the date in on January 1st each year.

Harald Staff wrote:

If we take efficiency to the extremes; any formula solution will recalculate
on every new cell entry in the workbook, while this job has to be done only
once a year. I'd put a small macro solution in the workbook_open event to
check which year it is and hardcode that proper new year date into the cell,
unless it's a very lightweight workbook that is.

Best wishes Harald

"Dave Peterson" skrev i melding
...
Although this formula works, it may not be the most efficient:


--

Dave Peterson


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
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
An Excel Formula Question JWCardington Excel Worksheet Functions 6 September 24th 05 09:00 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 07:48 PM
excel formula counting date to date in 4 columns stuie d Excel Worksheet Functions 1 May 4th 05 12:46 PM
Excel formula with date constraints Warrior Pope Excel Discussion (Misc queries) 3 January 28th 05 03:08 PM


All times are GMT +1. The time now is 12:02 PM.

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

About Us

"It's about Microsoft Excel"