A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

year - 1



 
 
Thread Tools Display Modes
  #1  
Old May 16th, 2009, 12:51 PM posted to microsoft.public.excel.worksheet.functions
alvin Kuiper
external usenet poster
 
Posts: 45
Default year - 1

Hi

Is there a way in a worksheet - Functions where i can
take a cell value (date) and make it a year less
like 01-11-2009 (danish date) shall be 01-11-2008

I can in VB, but can't find it in a waotksheet

alvin

  #2  
Old May 16th, 2009, 12:54 PM posted to microsoft.public.excel.worksheet.functions
Dave Peterson
external usenet poster
 
Posts: 19,791
Default year - 1

=date(year(a1)-1,month(a1),day(a1))

It'll work for almost every date except the leapyear dates (Feb 29, 2008 won't
give Feb 29, 2007).

alvin Kuiper wrote:

Hi

Is there a way in a worksheet - Functions where i can
take a cell value (date) and make it a year less
like 01-11-2009 (danish date) shall be 01-11-2008

I can in VB, but can't find it in a waotksheet

alvin


--

Dave Peterson
  #3  
Old May 16th, 2009, 12:56 PM posted to microsoft.public.excel.worksheet.functions
Gary''s Student
external usenet poster
 
Posts: 7,584
Default year - 1

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

Just be careful about leap years.
--
Gary''s Student - gsnu200853


"alvin Kuiper" wrote:

Hi

Is there a way in a worksheet - Functions where i can
take a cell value (date) and make it a year less
like 01-11-2009 (danish date) shall be 01-11-2008

I can in VB, but can't find it in a waotksheet

alvin

  #4  
Old May 16th, 2009, 01:04 PM posted to microsoft.public.excel.worksheet.functions
alvin Kuiper
external usenet poster
 
Posts: 45
Default year - 1


Thanks


Alvin
"Dave Peterson" skrev:

=date(year(a1)-1,month(a1),day(a1))

It'll work for almost every date except the leapyear dates (Feb 29, 2008 won't
give Feb 29, 2007).

alvin Kuiper wrote:

Hi

Is there a way in a worksheet - Functions where i can
take a cell value (date) and make it a year less
like 01-11-2009 (danish date) shall be 01-11-2008

I can in VB, but can't find it in a waotksheet

alvin


--

Dave Peterson

  #5  
Old May 16th, 2009, 01:18 PM posted to microsoft.public.excel.worksheet.functions
Dana DeLouis[_3_]
external usenet poster
 
Posts: 184
Default year - 1

Hi.

=EDATE(A1,-12)

Note that this will move a Feb 29 to Feb 28.

Dana DeLouis


alvin Kuiper wrote:
Hi

Is there a way in a worksheet - Functions where i can
take a cell value (date) and make it a year less
like 01-11-2009 (danish date) shall be 01-11-2008

I can in VB, but can't find it in a waotksheet

alvin

  #6  
Old May 17th, 2009, 06:12 AM posted to microsoft.public.excel.worksheet.functions
macropod[_2_]
external usenet poster
 
Posts: 2,402
Default year - 1

Hi Alvin,

Here's one that'll handle leap years:
=MIN(DATE(YEAR(A1),MONTH(A1)-{12,11},DAY(A1)*{1,0}))

--
Cheers
macropod
[Microsoft MVP - Word]


"alvin Kuiper" wrote in message ...
Hi

Is there a way in a worksheet - Functions where i can
take a cell value (date) and make it a year less
like 01-11-2009 (danish date) shall be 01-11-2008

I can in VB, but can't find it in a waotksheet

alvin

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:32 AM.


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