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  

Date fomula not working



 
 
Thread Tools Display Modes
  #1  
Old February 14th, 2009, 02:01 PM posted to microsoft.public.excel.worksheet.functions
FangYR
external usenet poster
 
Posts: 18
Default Date fomula not working

I have use this last year, it's fine until now. the formula is now new to Ron,
=DATE(YEAR(A2)-1,MONTH(A2),DAY(A2))-(MONTH(DATE(YEAR(A2)-1,MONTH(A2),DAY(A2)))MONTH(A2))
That is, I enter a month and day in A2 and it will appear as last year's
date, but now nothing changes, still in default year 2009.
Please advise.
--
Regards
FangYR
Malaysia
  #2  
Old February 14th, 2009, 02:22 PM posted to microsoft.public.excel.worksheet.functions
Max
external usenet poster
 
Posts: 8,574
Default Date fomula not working

.. I enter a month and day in A2
I'm not sure what your expression computes but A2 must contain a real date,
not just any sort of number. A real date is a full valid, unambiguous date
(day-month-year) recognized by Excel, eg: 01-Jan-2009. Try re-entering a real
date into A2.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:23,000 Files:370 Subscribers:66
xdemechanik
---
"FangYR" wrote:
I have use this last year, it's fine until now. the formula is now new to Ron,
=DATE(YEAR(A2)-1,MONTH(A2),DAY(A2))-(MONTH(DATE(YEAR(A2)-1,MONTH(A2),DAY(A2)))MONTH(A2))
That is, I enter a month and day in A2 and it will appear as last year's
date, but now nothing changes, still in default year 2009.
Please advise

  #3  
Old February 14th, 2009, 03:12 PM posted to microsoft.public.excel.worksheet.functions
Fred Smith[_4_]
external usenet poster
 
Posts: 2,386
Default Date fomula not working

Your formula works for me. I entered 3/1 (March 1st) in to A2, and got
2008-03-01 in my target cell. So your problem must be you are not entering
the date correctly.

Regards,
Fred.

"FangYR" wrote in message
...
I have use this last year, it's fine until now. the formula is now new to
Ron,
=DATE(YEAR(A2)-1,MONTH(A2),DAY(A2))-(MONTH(DATE(YEAR(A2)-1,MONTH(A2),DAY(A2)))MONTH(A2))
That is, I enter a month and day in A2 and it will appear as last year's
date, but now nothing changes, still in default year 2009.
Please advise.
--
Regards
FangYR
Malaysia


  #4  
Old February 14th, 2009, 04:12 PM posted to microsoft.public.excel.worksheet.functions
Shane Devenshire[_3_]
external usenet poster
 
Posts: 3,333
Default Date fomula not working

Hi,

The function is calculating the date one year prior with and adjustment for
leap years. It works as written.

However you might consider using the following which does exactly the same
thing:

=EDATE(A2,-12)

In Excel 2003 or earlier you will need to attach the ATP - Tools, Add-Ins,
and check Analysis ToolPak. In 2007 nothing to do.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"FangYR" wrote:

I have use this last year, it's fine until now. the formula is now new to Ron,
=DATE(YEAR(A2)-1,MONTH(A2),DAY(A2))-(MONTH(DATE(YEAR(A2)-1,MONTH(A2),DAY(A2)))MONTH(A2))
That is, I enter a month and day in A2 and it will appear as last year's
date, but now nothing changes, still in default year 2009.
Please advise.
--
Regards
FangYR
Malaysia

  #5  
Old February 14th, 2009, 06:15 PM posted to microsoft.public.excel.worksheet.functions
Rick Rothstein[_2_]
external usenet poster
 
Posts: 2,013
Default Date fomula not working

I'm pretty sure this simpler (than the original) non-ATP formula will also
work...

=A2-365-(DAY(A2)DAY(A2-365))

--
Rick (MVP - Excel)


"Shane Devenshire" wrote in
message ...
Hi,

The function is calculating the date one year prior with and adjustment
for
leap years. It works as written.

However you might consider using the following which does exactly the same
thing:

=EDATE(A2,-12)

In Excel 2003 or earlier you will need to attach the ATP - Tools, Add-Ins,
and check Analysis ToolPak. In 2007 nothing to do.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"FangYR" wrote:

I have use this last year, it's fine until now. the formula is now new to
Ron,
=DATE(YEAR(A2)-1,MONTH(A2),DAY(A2))-(MONTH(DATE(YEAR(A2)-1,MONTH(A2),DAY(A2)))MONTH(A2))
That is, I enter a month and day in A2 and it will appear as last year's
date, but now nothing changes, still in default year 2009.
Please advise.
--
Regards
FangYR
Malaysia


  #6  
Old February 14th, 2009, 11:59 PM posted to microsoft.public.excel.worksheet.functions
Fred Smith[_4_]
external usenet poster
 
Posts: 2,386
Default Date fomula not working

Good one, Rick.

Regards,
Fred.

"Rick Rothstein" wrote in message
...
I'm pretty sure this simpler (than the original) non-ATP formula will also
work...

=A2-365-(DAY(A2)DAY(A2-365))

--
Rick (MVP - Excel)


"Shane Devenshire" wrote in
message ...
Hi,

The function is calculating the date one year prior with and adjustment
for
leap years. It works as written.

However you might consider using the following which does exactly the
same
thing:

=EDATE(A2,-12)

In Excel 2003 or earlier you will need to attach the ATP - Tools,
Add-Ins,
and check Analysis ToolPak. In 2007 nothing to do.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"FangYR" wrote:

I have use this last year, it's fine until now. the formula is now new
to Ron,
=DATE(YEAR(A2)-1,MONTH(A2),DAY(A2))-(MONTH(DATE(YEAR(A2)-1,MONTH(A2),DAY(A2)))MONTH(A2))
That is, I enter a month and day in A2 and it will appear as last year's
date, but now nothing changes, still in default year 2009.
Please advise.
--
Regards
FangYR
Malaysia



  #7  
Old February 15th, 2009, 04:43 AM posted to microsoft.public.excel.worksheet.functions
FangYR
external usenet poster
 
Posts: 18
Default Date fomula not working

I am back again.
Thanks to all of you. I tried according to all your advices but it did'nt
work as it did before, even when trying on in older worksheets which worked
fine, then. I thing somthing "add-ons" sre missing. Let me try on that, then
come back to you all.
Thanks again
--
Regards
FangYR
Malaysia


"Fred Smith" wrote:

Good one, Rick.

Regards,
Fred.

"Rick Rothstein" wrote in message
...
I'm pretty sure this simpler (than the original) non-ATP formula will also
work...

=A2-365-(DAY(A2)DAY(A2-365))

--
Rick (MVP - Excel)


"Shane Devenshire" wrote in
message ...
Hi,

The function is calculating the date one year prior with and adjustment
for
leap years. It works as written.

However you might consider using the following which does exactly the
same
thing:

=EDATE(A2,-12)

In Excel 2003 or earlier you will need to attach the ATP - Tools,
Add-Ins,
and check Analysis ToolPak. In 2007 nothing to do.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"FangYR" wrote:

I have use this last year, it's fine until now. the formula is now new
to Ron,
=DATE(YEAR(A2)-1,MONTH(A2),DAY(A2))-(MONTH(DATE(YEAR(A2)-1,MONTH(A2),DAY(A2)))MONTH(A2))
That is, I enter a month and day in A2 and it will appear as last year's
date, but now nothing changes, still in default year 2009.
Please advise.
--
Regards
FangYR
Malaysia




  #8  
Old February 15th, 2009, 05:46 AM posted to microsoft.public.excel.worksheet.functions
FangYR
external usenet poster
 
Posts: 18
Default Date fomula not working

Hi All,
I have checked "Add-ons", install all, yet same result. to be specific,
cell G2, the formula, in A2, I enter "1/3" (ie 3th Jan) and I expect A2 to
read "3 Jan 2008", but "3 Jan 2009" appeared. Driving me cracy.
Any thing I might have miss out?
--
Regards
FangYR
Malaysia


"Fred Smith" wrote:

Your formula works for me. I entered 3/1 (March 1st) in to A2, and got
2008-03-01 in my target cell. So your problem must be you are not entering
the date correctly.

Regards,
Fred.

"FangYR" wrote in message
...
I have use this last year, it's fine until now. the formula is now new to
Ron,
=DATE(YEAR(A2)-1,MONTH(A2),DAY(A2))-(MONTH(DATE(YEAR(A2)-1,MONTH(A2),DAY(A2)))MONTH(A2))
That is, I enter a month and day in A2 and it will appear as last year's
date, but now nothing changes, still in default year 2009.
Please advise.
--
Regards
FangYR
Malaysia



  #9  
Old February 15th, 2009, 06:05 AM posted to microsoft.public.excel.worksheet.functions
Rick Rothstein[_2_]
external usenet poster
 
Posts: 2,013
Default Date fomula not working

Did you try this formula (which I posted earlier)?

=A2-365-(DAY(A2)DAY(A2-365))

I cannot find a way to not make it work, although you may want to use the
formula set up this way...

=IF(A2="","",A2-365-(DAY(A2)DAY(A2-365)))

so that it won't error out for empty cells (if you decide to copy it down in
anticipation of future date entries). Give it a try.

--
Rick (MVP - Excel)


"FangYR" wrote in message
...
I am back again.
Thanks to all of you. I tried according to all your advices but it did'nt
work as it did before, even when trying on in older worksheets which
worked
fine, then. I thing somthing "add-ons" sre missing. Let me try on that,
then
come back to you all.
Thanks again
--
Regards
FangYR
Malaysia


"Fred Smith" wrote:

Good one, Rick.

Regards,
Fred.

"Rick Rothstein" wrote in message
...
I'm pretty sure this simpler (than the original) non-ATP formula will
also
work...

=A2-365-(DAY(A2)DAY(A2-365))

--
Rick (MVP - Excel)


"Shane Devenshire" wrote in
message ...
Hi,

The function is calculating the date one year prior with and
adjustment
for
leap years. It works as written.

However you might consider using the following which does exactly the
same
thing:

=EDATE(A2,-12)

In Excel 2003 or earlier you will need to attach the ATP - Tools,
Add-Ins,
and check Analysis ToolPak. In 2007 nothing to do.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"FangYR" wrote:

I have use this last year, it's fine until now. the formula is now
new
to Ron,
=DATE(YEAR(A2)-1,MONTH(A2),DAY(A2))-(MONTH(DATE(YEAR(A2)-1,MONTH(A2),DAY(A2)))MONTH(A2))
That is, I enter a month and day in A2 and it will appear as last
year's
date, but now nothing changes, still in default year 2009.
Please advise.
--
Regards
FangYR
Malaysia




  #10  
Old February 15th, 2009, 06:10 AM posted to microsoft.public.excel.worksheet.functions
FangYR
external usenet poster
 
Posts: 18
Default Date fomula not working

Hi All,
I have checked "Add-ons", install all, yet same result. to be specific,
cell G2, the formula, in A2, I enter "1/3" (ie 3th Jan) and I expect A2 to
read "3 Jan 2008", but "3 Jan 2009" appeared. Driving me cracy.
Any thing I might have miss out?

--
Regards
FangYR
Malaysia


"FangYR" wrote:

I am back again.
Thanks to all of you. I tried according to all your advices but it did'nt
work as it did before, even when trying on in older worksheets which worked
fine, then. I thing somthing "add-ons" sre missing. Let me try on that, then
come back to you all.
Thanks again
--
Regards
FangYR
Malaysia


"Fred Smith" wrote:

Good one, Rick.

Regards,
Fred.

"Rick Rothstein" wrote in message
...
I'm pretty sure this simpler (than the original) non-ATP formula will also
work...

=A2-365-(DAY(A2)DAY(A2-365))

--
Rick (MVP - Excel)


"Shane Devenshire" wrote in
message ...
Hi,

The function is calculating the date one year prior with and adjustment
for
leap years. It works as written.

However you might consider using the following which does exactly the
same
thing:

=EDATE(A2,-12)

In Excel 2003 or earlier you will need to attach the ATP - Tools,
Add-Ins,
and check Analysis ToolPak. In 2007 nothing to do.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"FangYR" wrote:

I have use this last year, it's fine until now. the formula is now new
to Ron,
=DATE(YEAR(A2)-1,MONTH(A2),DAY(A2))-(MONTH(DATE(YEAR(A2)-1,MONTH(A2),DAY(A2)))MONTH(A2))
That is, I enter a month and day in A2 and it will appear as last year's
date, but now nothing changes, still in default year 2009.
Please advise.
--
Regards
FangYR
Malaysia



 




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 08:57 PM.


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