Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Shi Shi is offline
external usenet poster
 
Posts: 13
Default How to format a Date to a Real Numerical Date?

Hi,

I have a regular stock chart, just like any other stock
charts in the planet. The Horizontal Axis is the Date.
Usually, the Date will be displayed as 07/08/04 (mm/dd/yy)
format. How to format this Date to a Real Numerical Date?

VBA code or manual solutions are both acceptable.

Thank you,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to format a Date to a Real Numerical Date?

myDate = DateValue("string date"

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How to format a Date to a Real Numerical Date?

Hi Shi

Try using ths Clng conversion function.

For example, from the intermediate window:

?CLng(#07/09/2004#)
38237
?CLng(date)
38177

---
Regards,
Norman



"Shi" wrote in message
...
Hi,

I have a regular stock chart, just like any other stock
charts in the planet. The Horizontal Axis is the Date.
Usually, the Date will be displayed as 07/08/04 (mm/dd/yy)
format. How to format this Date to a Real Numerical Date?

VBA code or manual solutions are both acceptable.

Thank you,



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How to format a Date to a Real Numerical Date?

Hi Shi,

In my example, both results should (of course!) be 38177.


---
Regards,
Norman


"Norman Jones" wrote in message
...
Hi Shi

Try using ths Clng conversion function.

For example, from the intermediate window:

?CLng(#07/09/2004#)
38237
?CLng(date)
38177

---
Regards,
Norman



  #5   Report Post  
Posted to microsoft.public.excel.programming
Shi Shi is offline
external usenet poster
 
Posts: 13
Default How to format a Date to a Real Numerical Date?

Norman,

Thank you very much for your help.

Is this 38237 equivalent to which "Category" under the
Menu [Format]-[Format Cells]-[Number Tab]-[Category]?

===============
General
Number
Date
Text
Special
Custom
===============



-----Original Message-----
Hi Shi

Try using ths Clng conversion function.

For example, from the intermediate window:

?CLng(#07/09/2004#)
38237
?CLng(date)
38177

---
Regards,
Norman



"Shi" wrote in

message
...
Hi,

I have a regular stock chart, just like any other stock
charts in the planet. The Horizontal Axis is the Date.
Usually, the Date will be displayed as 07/08/04

(mm/dd/yy)
format. How to format this Date to a Real Numerical

Date?

VBA code or manual solutions are both acceptable.

Thank you,



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How to format a Date to a Real Numerical Date?

Hi Shi,

To display a date manually as its serial value, use the general format or
number format and set decimal places to 0.


---
Regards,
Norman



"Shi" wrote in message
...
Norman,

Thank you very much for your help.

Is this 38237 equivalent to which "Category" under the
Menu [Format]-[Format Cells]-[Number Tab]-[Category]?

===============
General
Number
Date
Text
Special
Custom
===============



-----Original Message-----
Hi Shi

Try using ths Clng conversion function.

For example, from the intermediate window:

?CLng(#07/09/2004#)
38237
?CLng(date)
38177

---
Regards,
Norman



"Shi" wrote in

message
...
Hi,

I have a regular stock chart, just like any other stock
charts in the planet. The Horizontal Axis is the Date.
Usually, the Date will be displayed as 07/08/04

(mm/dd/yy)
format. How to format this Date to a Real Numerical

Date?

VBA code or manual solutions are both acceptable.

Thank you,



.



  #7   Report Post  
Posted to microsoft.public.excel.programming
Shi Shi is offline
external usenet poster
 
Posts: 13
Default How to format a Date to a Real Numerical Date?

Norman,

This is really a big help. Thanks a lot.



-----Original Message-----
Hi Shi,

To display a date manually as its serial value, use the

general format or
number format and set decimal places to 0.


---
Regards,
Norman



"Shi" wrote in

message
...
Norman,

Thank you very much for your help.

Is this 38237 equivalent to which "Category" under the
Menu [Format]-[Format Cells]-[Number Tab]-[Category]?

===============
General
Number
Date
Text
Special
Custom
===============



-----Original Message-----
Hi Shi

Try using ths Clng conversion function.

For example, from the intermediate window:

?CLng(#07/09/2004#)
38237
?CLng(date)
38177

---
Regards,
Norman



"Shi" wrote in

message
...
Hi,

I have a regular stock chart, just like any other

stock
charts in the planet. The Horizontal Axis is the

Date.
Usually, the Date will be displayed as 07/08/04

(mm/dd/yy)
format. How to format this Date to a Real Numerical

Date?

VBA code or manual solutions are both acceptable.

Thank you,


.



.

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
making numerical date return mmmm format [email protected] Excel Worksheet Functions 7 February 9th 09 07:16 PM
Date format from numbers to a real date? Brw Excel Worksheet Functions 2 December 24th 08 02:33 AM
date in text format as a real date Mortir Excel Worksheet Functions 2 November 26th 07 06:03 PM
Help: How do I convert a text date into a real date format japorms Excel Worksheet Functions 4 August 2nd 06 06:36 PM
real date for column Jay New Users to Excel 2 October 17th 05 06:19 PM


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

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

About Us

"It's about Microsoft Excel"