Solved

Odd date results when using =TEXT()

Posted on 2014-03-06
4
121 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 33

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

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
Excel Web Add-in Where is Visual Basic used 9 80
Modify Text File with Excel Macro 13 49
drag and drop a row in excel 2010 5 44
MS Excel Count B Where A = X 5 14
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.
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.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

734 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