Solved

Odd date results when using =TEXT()

Posted on 2014-03-06
4
115 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 31

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now