PC Review


Reply
Thread Tools Rate Thread

Can I prevent Excel converting to date format?

 
 
et
Guest
Posts: n/a
 
      6th Sep 2005
I was wondering if there was a setting or any way to prevent Excel from
converting certain numbers to dates.

e.g. 11/7 will be converted automatically to 11/07/2005. This appears
as 11-Jul in the cell. This problem also happens with 11-7.

This is very annoying because it would appear that there is actually no
way of having two numbers (which happen to be low enough numbers to be
dates) separated by a forward slash or a hyphen.

Has anyone found a solution to this problem yet?

 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      6th Sep 2005
If you're typing these values into the cell, you can either prefix them with a
leading apostrophe:

'11/7

or preformat the cell as text (format|cells|number tab)
and type your entry.



et wrote:
>
> I was wondering if there was a setting or any way to prevent Excel from
> converting certain numbers to dates.
>
> e.g. 11/7 will be converted automatically to 11/07/2005. This appears
> as 11-Jul in the cell. This problem also happens with 11-7.
>
> This is very annoying because it would appear that there is actually no
> way of having two numbers (which happen to be low enough numbers to be
> dates) separated by a forward slash or a hyphen.
>
> Has anyone found a solution to this problem yet?


--

Dave Peterson
 
Reply With Quote
 
et
Guest
Posts: n/a
 
      6th Sep 2005
Thanks for this answer.

Do you happen to know if this is possible if I have a web page
converted to excel by changing the content type to
"application/x-msexcel"

I assume that I would need to change the format of the cell in code if
that's possible. I'm using ASP by the way.

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      6th Sep 2005
No, I don't know anything about ASP.

et wrote:
>
> Thanks for this answer.
>
> Do you happen to know if this is possible if I have a web page
> converted to excel by changing the content type to
> "application/x-msexcel"
>
> I assume that I would need to change the format of the cell in code if
> that's possible. I'm using ASP by the way.


--

Dave Peterson
 
Reply With Quote
 
0-0 Wai Wai ^-^
Guest
Posts: n/a
 
      6th Sep 2005

"Dave Peterson" <(E-Mail Removed)> ???
news:(E-Mail Removed) ???...
> If you're typing these values into the cell, you can either prefix them with a
> leading apostrophe:
>
> '11/7


Something I wonder:
If you do so, then excel should treat "the date" as **text**.
And you cannot use it to do calculations (eg calculate the date difference
between one and another).

But when I tried it out, it is not true. Calcuation can be made.
How come?



 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      6th Sep 2005
Depends on what calculation you're doing.

If you have a couple of text dates in A1 and B1:
'9/6
'9/9

Excel will do it's best to coerce the value to numbers in a formula like:
=b1-a1

Those arithmetic operators really help.

But other formulas won't do that coersion:

=SUMPRODUCT(--(A1:A10=DATE(2005,9,6)),--(B1:B10="red"))

=======
You can see it with a non-date example.

Put
'1 in A1
'2 in A2

=a1+a2 in A3
=sum(a1,a2) in A4
=sum(a1+0,a2+0) in A5




0-0 Wai Wai ^-^ wrote:
>
> "Dave Peterson" <(E-Mail Removed)> ???
> news:(E-Mail Removed) ???...
> > If you're typing these values into the cell, you can either prefix them with a
> > leading apostrophe:
> >
> > '11/7

>
> Something I wonder:
> If you do so, then excel should treat "the date" as **text**.
> And you cannot use it to do calculations (eg calculate the date difference
> between one and another).
>
> But when I tried it out, it is not true. Calcuation can be made.
> How come?


--

Dave Peterson
 
Reply With Quote
 
0-0 Wai Wai ^-^
Guest
Posts: n/a
 
      6th Sep 2005
Thanks so much for your detailed explanation.

"Dave Peterson" <(E-Mail Removed)> ???
news:(E-Mail Removed) ???...
> Depends on what calculation you're doing.
>
> If you have a couple of text dates in A1 and B1:
> '9/6
> '9/9
>
> Excel will do it's best to coerce the value to numbers in a formula like:
> =b1-a1
>
> Those arithmetic operators really help.
>
> But other formulas won't do that coersion:
>
> =SUMPRODUCT(--(A1:A10=DATE(2005,9,6)),--(B1:B10="red"))
>
> =======
> You can see it with a non-date example.
>
> Put
> '1 in A1
> '2 in A2
>
> =a1+a2 in A3
> =sum(a1,a2) in A4
> =sum(a1+0,a2+0) in A5
>
>
>
>
> 0-0 Wai Wai ^-^ wrote:
> >
> > "Dave Peterson" <(E-Mail Removed)> ???
> > news:(E-Mail Removed) ???...
> > > If you're typing these values into the cell, you can either prefix them

with a
> > > leading apostrophe:
> > >
> > > '11/7

> >
> > Something I wonder:
> > If you do so, then excel should treat "the date" as **text**.
> > And you cannot use it to do calculations (eg calculate the date difference
> > between one and another).
> >
> > But when I tried it out, it is not true. Calcuation can be made.
> > How come?

>
> --
>
> Dave Peterson



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting complex date format to normal date format in Excel BlackNarcissus Microsoft Excel Misc 0 28th Jul 2011 04:28 PM
Excel-How Do I prevent data conversion to date format =?Utf-8?B?TWFkSGF0dGVyOF8xMA==?= Microsoft Excel Programming 3 30th Sep 2007 08:28 PM
How do I prevent Excel from auto-correcting the date format? =?Utf-8?B?V2F0dHM=?= Microsoft Excel Misc 2 15th Sep 2005 02:08 PM
Excel keeps converting text to date format John T via OfficeKB.com Microsoft Excel Misc 4 12th Sep 2005 06:48 PM
Excel - Need help converting Date Format benallred99 Microsoft Excel Misc 3 13th Aug 2004 06:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:28 AM.