Solved

Odd date results when using =TEXT()

Posted on 2014-03-06
4
117 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 200 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 100 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 32

Accepted Solution

by:
Rob Henson earned 200 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

770 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