Excel: Displaying the Current Date and Time with TextLast reviewed: February 2, 1998Article ID: Q95951 |
The information in this article applies to:
SUMMARYYou can enter the current date and/or time as text by using the TEXT function with the TODAY or NOW functions. For example, to display "Today is 2/18/98" (without the quotations marks), where 2/18/98 is the current date, use the following formula:
="Today is "&TEXT(TODAY(),"m/d/yy")NOTE: You can substitute the NOW function for the TODAY function in the above formula to display the date and time or just the time (depending on the number format you specify). You can also display "Today is 2/18/98" (without the quotation marks), and preserve the value of the date as a serial number rather than converting it to text. To display the current time, use the following formula:
=NOW()-TODAY()This formula will update each time the sheet is calculated.
MORE INFORMATIONThe TEXT() function converts a value to text in a specified number format. To display the following
The current date and time is 2/18/93 5:57 PMuse this formula:
="The current date and time is "&TEXT(NOW(),"m/d/yy h:mm AM/PM")To display the following
The current time is 5:57 PMuse this formula:
="The current time is "&TEXT(NOW(),"h:mm AM/PM")If you want a linked formula in a chart to display this information but you do not want to open the file, use the TEXT() function (as discussed above). To display the time but preserve the value as a serial number, follow these steps:
REFERENCES"Microsoft Excel Function Reference," version 4.0, page 431-432 "Microsoft Excel Function Reference," version 3.0, page 234-235
|
Additional query words: XL98 XL97 XL7 XL5 XL4 XL3 5.00 3.00 4.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |