Solved

Odd date results when using =TEXT()

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SUMPRODUCT with criteriya 5 25
Generating a graph via Excel 3 23
Search for a value in Column? 5 21
Excel Conditional Formatting in a Macro 4 25
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…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

914 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

13 Experts available now in Live!

Get 1:1 Help Now