[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
Solved

# Formatting

Posted on 2011-02-23
Medium Priority
197 Views
Can anyone formatt Col G+H? I have tried but am failing

Just want them in date and time format

Thanks
Seamus
Example.xls
0
Question by:Seamus2626
[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
• 2
• 2
• 2
• +2

LVL 4

Expert Comment

ID: 34960273
could you upload the sourse file so that I can format it and see where the issue lies
0

Author Comment

ID: 34960287
here is the code that is creating the data in G+H

Thanks
Seamus
0

LVL 50

Accepted Solution

barry houdini earned 668 total points
ID: 34960291
Hello Seamus,

To get the date in G2 use

=INT(C2)

and for the time in H2

=MOD(C2,1)

format in date and time format respectively

regards, barry
0

LVL 19

Assisted Solution

MINDSUPERB earned 664 total points
ID: 34960297
Use this formula in G2 and H2
=VALUE(LEFT(C2,9))

Format Column G into Date and Column H into Time.

Sincerely,

Ed
0

LVL 19

Expert Comment

ID: 34960310
It must be only =VALUE(C2)

Ed
0

LVL 9

Assisted Solution

sah18 earned 668 total points
ID: 34960315
There are several ways to accomplish this.  I've attached one possible solution.
Example-with-corrected-date-time.xls
0

LVL 50

Expert Comment

ID: 34960358
Using LEFT(C2,9) is a mistake, I think. That would be fine if C2 was a text value.....but it's not so by extracting the first 9 characters you are actuallt taking the date serial number (5 digits) plus decimal point and then 3 decimal places. If you use VALUE function on that you can format as a date but the underlying value still contains the decimals (effectively a time) which might cause problems if you want to do other calculations with the value returned.

INT, as per my suggestion, just takes the integer portion of C2 (the date) and MOD(C2,1) takes the decimal part (the time)

regards, barry
0

Author Closing Comment

ID: 34960414
Thanks guys!
0

## Featured Post

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
###### Suggested Courses
Course of the Month12 days, 15 hours left to enroll