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
  #21  
Old February 16th, 2009, 04:10 PM posted to microsoft.public.excel.worksheet.functions
FangYR
external usenet poster
 
Posts: 18
Default Date fomula not working

Sorry, this one is correct
type 1/3 in A2. 39085 appeared in G2.

--
Regards
FangYR
Malaysia


"Rick Rothstein" wrote:

Telling us a result without telling us your input is meaningless... exactly
what did you type into A2 to get that 693231 value?

--
Rick (MVP - Excel)


"FangYR" wrote in message
...
In G2 ,
=DATE(YEAR(A2)-2,MONTH(A2),DAY(A2))-(MONTH(DATE(YEAR(A2)-2,MONTH(A2),DAY(A2)))MONTH(A2)),
number appeared, 693231.
any idea?
--
Regards
FangYR
Malaysia


"David Biddulph" wrote:

You'll need to tell us precisely what values you've got in which cells.
If you use the formula =A2 and format as General, what number do you
have?
If you use the formula =G2 and format as General, what number do you
have?
--
David Biddulph

"FangYR" wrote in message
...
I place the formula in G2, format cell A2 as dd-mmm-yyyy. whatever date
style
I enter, the year is still "2009".
It refuse to compute!
Ai!!!
--
Regards
FangYR
Malaysia


"Max" wrote:

.. in A2, I enter "1/3" (ie 3th Jan) and I expect A2 to
read "3 Jan 2008", but "3 Jan 2009" appeared.

well, that was precisely my point/sugegstion to you in my earlier
response,

A real date is a full valid, unambiguous date
(day-month-year) recognized by Excel, eg: 01-Jan-2009.

If you always practice entering dates as full dates, you won't get
caught
out with ambiguities such as what happened as you described. If you
don't
enter the date with the year in it - that's what you did, Excel will
then
assume the year is the current year (from the PC's clock), hence you
get:
"3
Jan 2009". You got "3 Jan 2008" previously because you entered it
sometime
last year (in 2008). Take my suggestion, never skimp on the data entry
step
when it comes to dates. Always enter it unambiguously in full,
inclusive
of
the year, and use "mmm" format to denote the month as well in the date
entry.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:23,000 Files:370 Subscribers:66
xdemechanik
---





  #22  
Old February 16th, 2009, 04:13 PM posted to microsoft.public.excel.worksheet.functions
Glenn[_6_]
external usenet poster
 
Posts: 1,245
Default Date fomula not working

FangYR wrote:
A2, 1/3. G2, 693231.


Your entry of 1/3 in A2 is being evaluated as .3333333 (1 divided by 3). Either
enter an apostrophe in front ('1/3) or pre-format the cell as date.
  #23  
Old February 16th, 2009, 04:26 PM posted to microsoft.public.excel.worksheet.functions
FangYR
external usenet poster
 
Posts: 18
Default Date fomula not working

column A was format as "date"
--
Regards
FangYR
Malaysia


"Glenn" wrote:

FangYR wrote:
A2, 1/3. G2, 693231.


Your entry of 1/3 in A2 is being evaluated as .3333333 (1 divided by 3). Either
enter an apostrophe in front ('1/3) or pre-format the cell as date.

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

That number makes more sense. 39085 is a "date" to Excel... it is the number
of days since January 1, 1900. Format that cell as Date and the 39045 will
change to 1/3/2007. Now, the reason for the 2007 instead of 2008 is because
you are subtracting 2 from the YEAR(A2) value (hence 2 years prior) instead
of subtracting 1 (to get last year).

By the way, if you only want last years date (the formula I'm about to give
you will only work to give last year's date), then give this much simpler
(and more efficient) formula a try...

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

It subtracts the 365 days in a normal year and if the day values between the
date in A2 and the date 365 days earlier don't match, then a leap year was
present, so it subtracts an additional day to skip over it. Note, you will
probably still have to reformat the cell to Date after entering this formula
as well.

--
Rick (MVP - Excel)


"FangYR" wrote in message
...
Sorry, this one is correct
type 1/3 in A2. 39085 appeared in G2.

--
Regards
FangYR
Malaysia


"Rick Rothstein" wrote:

Telling us a result without telling us your input is meaningless...
exactly
what did you type into A2 to get that 693231 value?

--
Rick (MVP - Excel)


"FangYR" wrote in message
...
In G2 ,
=DATE(YEAR(A2)-2,MONTH(A2),DAY(A2))-(MONTH(DATE(YEAR(A2)-2,MONTH(A2),DAY(A2)))MONTH(A2)),
number appeared, 693231.
any idea?
--
Regards
FangYR
Malaysia


"David Biddulph" wrote:

You'll need to tell us precisely what values you've got in which
cells.
If you use the formula =A2 and format as General, what number do you
have?
If you use the formula =G2 and format as General, what number do you
have?
--
David Biddulph

"FangYR" wrote in message
...
I place the formula in G2, format cell A2 as dd-mmm-yyyy. whatever
date
style
I enter, the year is still "2009".
It refuse to compute!
Ai!!!
--
Regards
FangYR
Malaysia


"Max" wrote:

.. in A2, I enter "1/3" (ie 3th Jan) and I expect A2 to
read "3 Jan 2008", but "3 Jan 2009" appeared.

well, that was precisely my point/sugegstion to you in my earlier
response,

A real date is a full valid, unambiguous date
(day-month-year) recognized by Excel, eg: 01-Jan-2009.

If you always practice entering dates as full dates, you won't get
caught
out with ambiguities such as what happened as you described. If you
don't
enter the date with the year in it - that's what you did, Excel
will
then
assume the year is the current year (from the PC's clock), hence
you
get:
"3
Jan 2009". You got "3 Jan 2008" previously because you entered it
sometime
last year (in 2008). Take my suggestion, never skimp on the data
entry
step
when it comes to dates. Always enter it unambiguously in full,
inclusive
of
the year, and use "mmm" format to denote the month as well in the
date
entry.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:23,000 Files:370 Subscribers:66
xdemechanik
---






  #25  
Old February 16th, 2009, 09:22 PM posted to microsoft.public.excel.worksheet.functions
Max
external usenet poster
 
Posts: 8,574
Default Date fomula not working

column A was format as "date"

Formatting only affects the display of the data that you enter, it doesn't
change the underlying data that is entered.

Like I said earlier / right at the onset in this thread:
---------------------------------
If you meant to enter the date: 3 Jan 2008 into A2,
Don't enter the date like this: 1/3 no good, ambiguous
Always enter dates in FULL like this: 3 Jan 2008

Hope the message above percolates through ... eventually
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:23,000 Files:370 Subscribers:66
xdemechanik
---


  #26  
Old February 17th, 2009, 12:42 AM posted to microsoft.public.excel.worksheet.functions
FangYR
external usenet poster
 
Posts: 18
Default Date fomula not working

Thanks all of you for the effort.
As I have stated in the beginning, that formula works before.
I am entering last year's bills as a record. So, I would like to type in A2
a date (ie 1/3) that will automatically appear as dd/mmm/2008 (in cell A2,
B2, C2, etc.), instead of the current year.
If I have to type the full date in column A (eg. 3/1/2008), then putting a
formula in column G serves no purpose. Hope I am making it clearer this time.
column A =date column G =formula

Going to work now, see you all later.
Cheers.
- -
Regards
FangYR
Malaysia


"Rick Rothstein" wrote:

That number makes more sense. 39085 is a "date" to Excel... it is the number
of days since January 1, 1900. Format that cell as Date and the 39045 will
change to 1/3/2007. Now, the reason for the 2007 instead of 2008 is because
you are subtracting 2 from the YEAR(A2) value (hence 2 years prior) instead
of subtracting 1 (to get last year).

By the way, if you only want last years date (the formula I'm about to give
you will only work to give last year's date), then give this much simpler
(and more efficient) formula a try...

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

It subtracts the 365 days in a normal year and if the day values between the
date in A2 and the date 365 days earlier don't match, then a leap year was
present, so it subtracts an additional day to skip over it. Note, you will
probably still have to reformat the cell to Date after entering this formula
as well.

--
Rick (MVP - Excel)


"FangYR" wrote in message
...
Sorry, this one is correct
type 1/3 in A2. 39085 appeared in G2.

--
Regards
FangYR
Malaysia


"Rick Rothstein" wrote:

Telling us a result without telling us your input is meaningless...
exactly
what did you type into A2 to get that 693231 value?

--
Rick (MVP - Excel)


"FangYR" wrote in message
...
In G2 ,
=DATE(YEAR(A2)-2,MONTH(A2),DAY(A2))-(MONTH(DATE(YEAR(A2)-2,MONTH(A2),DAY(A2)))MONTH(A2)),
number appeared, 693231.
any idea?
--
Regards
FangYR
Malaysia


"David Biddulph" wrote:

You'll need to tell us precisely what values you've got in which
cells.
If you use the formula =A2 and format as General, what number do you
have?
If you use the formula =G2 and format as General, what number do you
have?
--
David Biddulph

"FangYR" wrote in message
...
I place the formula in G2, format cell A2 as dd-mmm-yyyy. whatever
date
style
I enter, the year is still "2009".
It refuse to compute!
Ai!!!
--
Regards
FangYR
Malaysia


"Max" wrote:

.. in A2, I enter "1/3" (ie 3th Jan) and I expect A2 to
read "3 Jan 2008", but "3 Jan 2009" appeared.

well, that was precisely my point/sugegstion to you in my earlier
response,

A real date is a full valid, unambiguous date
(day-month-year) recognized by Excel, eg: 01-Jan-2009.

If you always practice entering dates as full dates, you won't get
caught
out with ambiguities such as what happened as you described. If you
don't
enter the date with the year in it - that's what you did, Excel
will
then
assume the year is the current year (from the PC's clock), hence
you
get:
"3
Jan 2009". You got "3 Jan 2008" previously because you entered it
sometime
last year (in 2008). Take my suggestion, never skimp on the data
entry
step
when it comes to dates. Always enter it unambiguously in full,
inclusive
of
the year, and use "mmm" format to denote the month as well in the
date
entry.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:23,000 Files:370 Subscribers:66
xdemechanik
---







  #27  
Old February 17th, 2009, 01:19 AM posted to microsoft.public.excel.worksheet.functions
Fred Smith[_4_]
external usenet poster
 
Posts: 2,386
Default Date fomula not working

If all you're entering is 1/3, Excel assumes the current year. How would
Excel to know that you want last year, unless you told it? Defaulting to the
current year is a very reasonable assumption on Excel's part, one that most
people would want. If you want something different, your choices a

1. Change your computer clock to 2008.
2. Enter the extra digits for the year (ie 1/3/8) -- it's only two
characters.
3. Enter all your dates in d/m format, to which Excel will add 2009. Add
another column which subtracts one year. Use that column for your purposes.
4. Write a macro to capture your entered date (1/3), and change it to 2008.

All in all, I think option 2 is the best, but it's up to you.

Regards,
Fred.

"FangYR" wrote in message
...
Thanks all of you for the effort.
As I have stated in the beginning, that formula works before.
I am entering last year's bills as a record. So, I would like to type in
A2
a date (ie 1/3) that will automatically appear as dd/mmm/2008 (in cell A2,
B2, C2, etc.), instead of the current year.
If I have to type the full date in column A (eg. 3/1/2008), then putting a
formula in column G serves no purpose. Hope I am making it clearer this
time.
column A =date column G =formula

Going to work now, see you all later.
Cheers.
- -
Regards
FangYR
Malaysia


"Rick Rothstein" wrote:

That number makes more sense. 39085 is a "date" to Excel... it is the
number
of days since January 1, 1900. Format that cell as Date and the 39045
will
change to 1/3/2007. Now, the reason for the 2007 instead of 2008 is
because
you are subtracting 2 from the YEAR(A2) value (hence 2 years prior)
instead
of subtracting 1 (to get last year).

By the way, if you only want last years date (the formula I'm about to
give
you will only work to give last year's date), then give this much simpler
(and more efficient) formula a try...

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

It subtracts the 365 days in a normal year and if the day values between
the
date in A2 and the date 365 days earlier don't match, then a leap year
was
present, so it subtracts an additional day to skip over it. Note, you
will
probably still have to reformat the cell to Date after entering this
formula
as well.

--
Rick (MVP - Excel)


"FangYR" wrote in message
...
Sorry, this one is correct
type 1/3 in A2. 39085 appeared in G2.

--
Regards
FangYR
Malaysia


"Rick Rothstein" wrote:

Telling us a result without telling us your input is meaningless...
exactly
what did you type into A2 to get that 693231 value?

--
Rick (MVP - Excel)


"FangYR" wrote in message
...
In G2 ,
=DATE(YEAR(A2)-2,MONTH(A2),DAY(A2))-(MONTH(DATE(YEAR(A2)-2,MONTH(A2),DAY(A2)))MONTH(A2)),
number appeared, 693231.
any idea?
--
Regards
FangYR
Malaysia


"David Biddulph" wrote:

You'll need to tell us precisely what values you've got in which
cells.
If you use the formula =A2 and format as General, what number do
you
have?
If you use the formula =G2 and format as General, what number do
you
have?
--
David Biddulph

"FangYR" wrote in message
...
I place the formula in G2, format cell A2 as dd-mmm-yyyy. whatever
date
style
I enter, the year is still "2009".
It refuse to compute!
Ai!!!
--
Regards
FangYR
Malaysia


"Max" wrote:

.. in A2, I enter "1/3" (ie 3th Jan) and I expect A2 to
read "3 Jan 2008", but "3 Jan 2009" appeared.

well, that was precisely my point/sugegstion to you in my
earlier
response,

A real date is a full valid, unambiguous date
(day-month-year) recognized by Excel, eg: 01-Jan-2009.

If you always practice entering dates as full dates, you won't
get
caught
out with ambiguities such as what happened as you described. If
you
don't
enter the date with the year in it - that's what you did, Excel
will
then
assume the year is the current year (from the PC's clock), hence
you
get:
"3
Jan 2009". You got "3 Jan 2008" previously because you entered
it
sometime
last year (in 2008). Take my suggestion, never skimp on the data
entry
step
when it comes to dates. Always enter it unambiguously in full,
inclusive
of
the year, and use "mmm" format to denote the month as well in
the
date
entry.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:23,000 Files:370 Subscribers:66
xdemechanik
---








  #28  
Old February 17th, 2009, 10:15 AM posted to microsoft.public.excel.worksheet.functions
David Biddulph
external usenet poster
 
Posts: 8,714
Default Date fomula not working

If you want all your dates to be shifted to a specific year, put that year
in G1, for example, and make your G2 formula
=DATE(YEAR(G$1),MONTH(A2),DAY(A2))
--
David Biddulph

FangYR wrote:
Thanks all of you for the effort.
As I have stated in the beginning, that formula works before.
I am entering last year's bills as a record. So, I would like to type
in A2 a date (ie 1/3) that will automatically appear as dd/mmm/2008
(in cell A2, B2, C2, etc.), instead of the current year.
If I have to type the full date in column A (eg. 3/1/2008), then
putting a formula in column G serves no purpose. Hope I am making it
clearer this time. column A =date column G
=formula

Going to work now, see you all later.
Cheers.
- -
Regards
FangYR
Malaysia


"Rick Rothstein" wrote:

That number makes more sense. 39085 is a "date" to Excel... it is
the number of days since January 1, 1900. Format that cell as Date
and the 39045 will change to 1/3/2007. Now, the reason for the 2007
instead of 2008 is because you are subtracting 2 from the YEAR(A2)
value (hence 2 years prior) instead of subtracting 1 (to get last
year).

By the way, if you only want last years date (the formula I'm about
to give you will only work to give last year's date), then give this
much simpler (and more efficient) formula a try...

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

It subtracts the 365 days in a normal year and if the day values
between the date in A2 and the date 365 days earlier don't match,
then a leap year was present, so it subtracts an additional day to
skip over it. Note, you will probably still have to reformat the
cell to Date after entering this formula as well.

--
Rick (MVP - Excel)


"FangYR" wrote in message
...
Sorry, this one is correct
type 1/3 in A2. 39085 appeared in G2.

--
Regards
FangYR
Malaysia


"Rick Rothstein" wrote:

Telling us a result without telling us your input is meaningless...
exactly
what did you type into A2 to get that 693231 value?

--
Rick (MVP - Excel)


"FangYR" wrote in message
...
In G2 ,
=DATE(YEAR(A2)-2,MONTH(A2),DAY(A2))-(MONTH(DATE(YEAR(A2)-2,MONTH(A2),DAY(A2)))MONTH(A2)),
number appeared, 693231.
any idea?
--
Regards
FangYR
Malaysia


"David Biddulph" wrote:

You'll need to tell us precisely what values you've got in which
cells.
If you use the formula =A2 and format as General, what number do
you have?
If you use the formula =G2 and format as General, what number do
you have?
--
David Biddulph

"FangYR" wrote in message
...
I place the formula in G2, format cell A2 as dd-mmm-yyyy.
whatever date
style
I enter, the year is still "2009".
It refuse to compute!
Ai!!!
--
Regards
FangYR
Malaysia


"Max" wrote:

.. in A2, I enter "1/3" (ie 3th Jan) and I expect A2 to
read "3 Jan 2008", but "3 Jan 2009" appeared.

well, that was precisely my point/sugegstion to you in my
earlier response,

A real date is a full valid, unambiguous date
(day-month-year) recognized by Excel, eg: 01-Jan-2009.

If you always practice entering dates as full dates, you won't
get caught
out with ambiguities such as what happened as you described.
If you don't
enter the date with the year in it - that's what you did, Excel
will
then
assume the year is the current year (from the PC's clock),
hence you
get:
"3
Jan 2009". You got "3 Jan 2008" previously because you entered
it sometime
last year (in 2008). Take my suggestion, never skimp on the
data entry
step
when it comes to dates. Always enter it unambiguously in full,
inclusive
of
the year, and use "mmm" format to denote the month as well in
the date
entry.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:23,000 Files:370 Subscribers:66
xdemechanik
---



  #29  
Old February 17th, 2009, 10:16 AM posted to microsoft.public.excel.worksheet.functions
David Biddulph
external usenet poster
 
Posts: 8,714
Default Date fomula not working

Correction:
=DATE(G$1,MONTH(A2),DAY(A2))
--
David Biddulph

David Biddulph wrote:
If you want all your dates to be shifted to a specific year, put that
year in G1, for example, and make your G2 formula
=DATE(YEAR(G$1),MONTH(A2),DAY(A2))

FangYR wrote:
Thanks all of you for the effort.
As I have stated in the beginning, that formula works before.
I am entering last year's bills as a record. So, I would like to type
in A2 a date (ie 1/3) that will automatically appear as dd/mmm/2008
(in cell A2, B2, C2, etc.), instead of the current year.
If I have to type the full date in column A (eg. 3/1/2008), then
putting a formula in column G serves no purpose. Hope I am making it
clearer this time. column A =date column G
=formula

Going to work now, see you all later.
Cheers.
- -
Regards
FangYR
Malaysia


"Rick Rothstein" wrote:

That number makes more sense. 39085 is a "date" to Excel... it is
the number of days since January 1, 1900. Format that cell as Date
and the 39045 will change to 1/3/2007. Now, the reason for the 2007
instead of 2008 is because you are subtracting 2 from the YEAR(A2)
value (hence 2 years prior) instead of subtracting 1 (to get last
year).

By the way, if you only want last years date (the formula I'm about
to give you will only work to give last year's date), then give this
much simpler (and more efficient) formula a try...

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

It subtracts the 365 days in a normal year and if the day values
between the date in A2 and the date 365 days earlier don't match,
then a leap year was present, so it subtracts an additional day to
skip over it. Note, you will probably still have to reformat the
cell to Date after entering this formula as well.

--
Rick (MVP - Excel)


"FangYR" wrote in message
...
Sorry, this one is correct
type 1/3 in A2. 39085 appeared in G2.

--
Regards
FangYR
Malaysia


"Rick Rothstein" wrote:

Telling us a result without telling us your input is
meaningless... exactly
what did you type into A2 to get that 693231 value?

--
Rick (MVP - Excel)


"FangYR" wrote in message
...
In G2 ,
=DATE(YEAR(A2)-2,MONTH(A2),DAY(A2))-(MONTH(DATE(YEAR(A2)-2,MONTH(A2),DAY(A2)))MONTH(A2)),
number appeared, 693231.
any idea?
--
Regards
FangYR
Malaysia


"David Biddulph" wrote:

You'll need to tell us precisely what values you've got in which
cells.
If you use the formula =A2 and format as General, what number do
you have?
If you use the formula =G2 and format as General, what number do
you have?
--
David Biddulph

"FangYR" wrote in message
...
I place the formula in G2, format cell A2 as dd-mmm-yyyy.
whatever date
style
I enter, the year is still "2009".
It refuse to compute!
Ai!!!
--
Regards
FangYR
Malaysia


"Max" wrote:

.. in A2, I enter "1/3" (ie 3th Jan) and I expect A2 to
read "3 Jan 2008", but "3 Jan 2009" appeared.

well, that was precisely my point/sugegstion to you in my
earlier response,

A real date is a full valid, unambiguous date
(day-month-year) recognized by Excel, eg: 01-Jan-2009.

If you always practice entering dates as full dates, you won't
get caught
out with ambiguities such as what happened as you described.
If you don't
enter the date with the year in it - that's what you did,
Excel will
then
assume the year is the current year (from the PC's clock),
hence you
get:
"3
Jan 2009". You got "3 Jan 2008" previously because you entered
it sometime
last year (in 2008). Take my suggestion, never skimp on the
data entry
step
when it comes to dates. Always enter it unambiguously in full,
inclusive
of
the year, and use "mmm" format to denote the month as well in
the date
entry.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:23,000 Files:370 Subscribers:66
xdemechanik
---



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

Fred wrote:
" Enter all your dates in d/m format, to which Excel will add 2009. Add
another column which subtracts one year. Use that column for your purposes."
This is what I have been stressing all the while.
In G2 this formula was
inserted:=DATE(YEAR(A2)-1,MONTH(A2),DAY(A2))-(MONTH(DATE(YEAR(A2)-1,MONTH(A2),DAY(A2)))MONTH(A2)),
and i expext Excel to make changes in A2 to give this "3-Jan-2008" reading.
This worked last year, but not any more. Need a solution, that's all.
If this formula works with your computer and not mine, I like to know where
went wrong.
Thanks for all your patience.


--
Regards
FangYR
Malaysia


"Fred Smith" wrote:

If all you're entering is 1/3, Excel assumes the current year. How would
Excel to know that you want last year, unless you told it? Defaulting to the
current year is a very reasonable assumption on Excel's part, one that most
people would want. If you want something different, your choices a

1. Change your computer clock to 2008.
2. Enter the extra digits for the year (ie 1/3/8) -- it's only two
characters.
3. Enter all your dates in d/m format, to which Excel will add 2009. Add
another column which subtracts one year. Use that column for your purposes.
4. Write a macro to capture your entered date (1/3), and change it to 2008.

All in all, I think option 2 is the best, but it's up to you.

Regards,
Fred.

"FangYR" wrote in message
...
Thanks all of you for the effort.
As I have stated in the beginning, that formula works before.
I am entering last year's bills as a record. So, I would like to type in
A2
a date (ie 1/3) that will automatically appear as dd/mmm/2008 (in cell A2,
B2, C2, etc.), instead of the current year.
If I have to type the full date in column A (eg. 3/1/2008), then putting a
formula in column G serves no purpose. Hope I am making it clearer this
time.
column A =date column G =formula

Going to work now, see you all later.
Cheers.
- -
Regards
FangYR
Malaysia


"Rick Rothstein" wrote:

That number makes more sense. 39085 is a "date" to Excel... it is the
number
of days since January 1, 1900. Format that cell as Date and the 39045
will
change to 1/3/2007. Now, the reason for the 2007 instead of 2008 is
because
you are subtracting 2 from the YEAR(A2) value (hence 2 years prior)
instead
of subtracting 1 (to get last year).

By the way, if you only want last years date (the formula I'm about to
give
you will only work to give last year's date), then give this much simpler
(and more efficient) formula a try...

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

It subtracts the 365 days in a normal year and if the day values between
the
date in A2 and the date 365 days earlier don't match, then a leap year
was
present, so it subtracts an additional day to skip over it. Note, you
will
probably still have to reformat the cell to Date after entering this
formula
as well.

--
Rick (MVP - Excel)


"FangYR" wrote in message
...
Sorry, this one is correct
type 1/3 in A2. 39085 appeared in G2.

--
Regards
FangYR
Malaysia


"Rick Rothstein" wrote:

Telling us a result without telling us your input is meaningless...
exactly
what did you type into A2 to get that 693231 value?

--
Rick (MVP - Excel)


"FangYR" wrote in message
...
In G2 ,
=DATE(YEAR(A2)-2,MONTH(A2),DAY(A2))-(MONTH(DATE(YEAR(A2)-2,MONTH(A2),DAY(A2)))MONTH(A2)),
number appeared, 693231.
any idea?
--
Regards
FangYR
Malaysia


"David Biddulph" wrote:

You'll need to tell us precisely what values you've got in which
cells.
If you use the formula =A2 and format as General, what number do
you
have?
If you use the formula =G2 and format as General, what number do
you
have?
--
David Biddulph

"FangYR" wrote in message
...
I place the formula in G2, format cell A2 as dd-mmm-yyyy. whatever
date
style
I enter, the year is still "2009".
It refuse to compute!
Ai!!!
--
Regards
FangYR
Malaysia


"Max" wrote:

.. in A2, I enter "1/3" (ie 3th Jan) and I expect A2 to
read "3 Jan 2008", but "3 Jan 2009" appeared.

well, that was precisely my point/sugegstion to you in my
earlier
response,

A real date is a full valid, unambiguous date
(day-month-year) recognized by Excel, eg: 01-Jan-2009.

If you always practice entering dates as full dates, you won't
get
caught
out with ambiguities such as what happened as you described. If
you
don't
enter the date with the year in it - that's what you did, Excel
will
then
assume the year is the current year (from the PC's clock), hence
you
get:
"3
Jan 2009". You got "3 Jan 2008" previously because you entered
it
sometime
last year (in 2008). Take my suggestion, never skimp on the data
entry
step
when it comes to dates. Always enter it unambiguously in full,
inclusive
of
the year, and use "mmm" format to denote the month as well in
the
date
entry.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:23,000 Files:370 Subscribers:66
xdemechanik
---









 




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 10:50 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.