Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Odd date results when using =TEXT()

Posted on 2014-03-06
4
Medium Priority
?
132 Views
Last Modified: 2014-03-22
Hello,

Is there something about the =TEXT() function in Excel that causes it to display incorrect information regarding dates?

For example, in the following screenshot from an .xlsm worksheet, typical date entries are present in column B. Each of the corresponding cells in column C contains a formula which is displayed in red in column D.

aNote that cells C2 & C4 contain typical date functions and display accurate information. However, when the very same date functions are used as the value argument in =TEXT() functions (cells 3, 5 & 6), the results are no longer accurate.

Can anyone explain why?

Thanks
0
Comment
Question by:WeThotUWasAToad
4 Comments
 
LVL 23

Assisted Solution

by:NBVC
NBVC earned 800 total points
ID: 39910298
When you are referencing a date with the TEXT function, you need to reference the whole date (serial number).. not just the Day() or Month((

e.g..  =TEXT(B3,"ddd")

         =TEXT(B5,"mmmm")


etc...
0
 
LVL 39

Assisted Solution

by:nutsch
nutsch earned 400 total points
ID: 39910370
Excel stores dates as number of days since 12/31/1899, so 1=1/1/1900.

In your formula =text(month(b5),"mmmm"), the month() part of your formula returns 3, which Excel then converts to 1/3/1900, i.e. a date in January.

Thomas
0
 
LVL 34

Accepted Solution

by:
Rob Henson earned 800 total points
ID: 39910607
Why use the TEXT function at all?

You can get the same results purely with custom formatting.

For your examples:
B3 - 03/07/14 - formatted as "ddd" will show "Friday"
B5 - 03/09/14 - formatted as "mmmm" will show "March"
B6 - 03/10/14 - formatted as "mmmm, yyyy" will show "March, 2014"

This way your dates then stay as true numbers but show on screen as you want them displayed so need for conversion back to numbers if then using them in other calculations.

Cheers
Rob H
0
 

Author Closing Comment

by:WeThotUWasAToad
ID: 39947896
Thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

879 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question