How to format a Date to a Real Numerical Date?

  • Thread starter Thread starter Shi
  • Start date Start date
S

Shi

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,
 
Hi Shi

Try using ths Clng conversion function.

For example, from the intermediate window:

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

In my example, both results should (of course!) be 38177.
 
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
===============
 
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 said:
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






.
 
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



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



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,


.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top