Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-20-2013, 10:18 PM
Aikeedoh Aikeedoh is offline Text auto formatted as date format Windows 7 64bit Text auto formatted as date format Office 2013
Novice
Text auto formatted as date format
 
Join Date: Aug 2013
Posts: 2
Aikeedoh is on a distinguished road
Default Text auto formatted as date format

Hi,

I am working on an Excel table with data looking like this 100:03:00. I select the cell and it shows cell's value as 1/4/1900 4:03:00 AM.



I want the cell value to be shown as 100:03:00 as I will be using vlookup function to look for these in another table.

Thanks.
Reply With Quote
  #2  
Old 08-21-2013, 08:50 AM
BobBridges's Avatar
BobBridges BobBridges is offline Text auto formatted as date format Windows 7 64bit Text auto formatted as date format Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Aikeedoh, I'm not understanding something about your description. There are two ways the value of a cell is displayed in Excel. (Actually, someone else may chime in here and tell me there are more than two, but I can think of two just now). The ordinary way is in the cell itself; you use formatting strings to control that. And the other is what you see in the formula bar at the top when you select the cell.

Now, you say the data "looks like this 100:03:00", and I suppose you mean in the cell. And you say you want it "to be shown as 100:03:00", and again I suppose you mean in the cell. So if you want it to look the way it already looks, what's the problem? And yes, when I type 100:03:00 in a cell, it shows up as 1900-01-04 04:03:00 in my formula bar; that's normal.

Second, you're worried about how it will work with VLOOKUP. But unless I've misunderstood you, that isn't a problem; how it's formatted won't affect Excel's ability to find it with one of the lookup functions. You could display it as "100:03:00", "4.16875", "4.169E+00", "4 27/160" or anything else you can think of and Excel will still find it correctly with VLOOKUP.
Reply With Quote
  #3  
Old 08-21-2013, 09:46 AM
Aikeedoh Aikeedoh is offline Text auto formatted as date format Windows 7 64bit Text auto formatted as date format Office 2013
Novice
Text auto formatted as date format
 
Join Date: Aug 2013
Posts: 2
Aikeedoh is on a distinguished road
Default

Bob,

Sorry for not being clearer. Yes, the cell is displaying "100:03:00", but when I do a VLOOKUP from another sheet, the returned value is not "100:03:00", but instead it is returning a different value "4.16875". What can I do to have the returned value displayed as "100:03:00"?

Thanks
Reply With Quote
  #4  
Old 08-21-2013, 12:27 PM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Text auto formatted as date format Windows 7 64bit Text auto formatted as date format Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,771
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

It would be easier if you posted a sample sheet
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #5  
Old 08-21-2013, 01:08 PM
BobBridges's Avatar
BobBridges BobBridges is offline Text auto formatted as date format Windows 7 64bit Text auto formatted as date format Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Ah, I see. 4.16875 is actually the correct value, Aikeedoh; it's just not formatted the way you want.

Let's say that the worksheet where you're doing the VLOOKUP is named Master, and the worksheet it's looking at is Target. In Target it looks right ("100:03:00"), but in Master it's wrong ("4.16875")—or rather the value is right, but the format is wrong. In Master, change the formatting to "[h]:mm:ss", and 4.16875 will be displayed as "100:03:00".

Here's why: Excel stores dates and times as whole numbers. 4 is four days; 4.5 is four and a half days, ie 4 days and 12 hours. Just now the date and time where I am is 41507.66646, that is, 41507 days since 1900-01-01, plus .66646 of another day. That comes out to 2013-08-21 15:59:42.550, you see.

Now, what Excel is finding is 4.16875. If you tell Excel to format the result (in Master) as "yyyy-mm-dd", it'll ignore the time part and just display "1900-01-04" (four days since the start of 1900). If you format it as "hh:mm:ss", it'll ignore the whole days and show just the fraction of the day as "04:03:00". But put square brackets around the hours, "[h]:mm:ss", and it'll show it the way you want.
Reply With Quote
  #6  
Old 09-06-2013, 02:38 AM
C J Squibb C J Squibb is offline Text auto formatted as date format Windows 7 64bit Text auto formatted as date format Office 2010 32bit
Novice
 
Join Date: Aug 2013
Location: Essex
Posts: 14
C J Squibb is on a distinguished road
Default

Your problem is that Excel converts anything that vaguely looks like a date INTO a date. Simply change the number format of this column to Text and you should be OK. Your value is not really a number, it is text composed of alphanumeric characters which happen to be mostly digits - but this is not the sort of number used in calculations.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
AutoCorrect with Formatted Text pmokover Word 15 05-11-2017 08:50 PM
Auto Date klaws Outlook 0 08-24-2012 01:01 PM
date format gsrikanth Excel 1 12-28-2011 05:06 AM
Import formatted text from Word into PowerPoint parboy PowerPoint 0 07-06-2011 08:52 AM
Auto Update the date. Nirik Excel 16 12-16-2010 04:23 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:37 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft