ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Splitting data in a cell (https://www.excelbanter.com/excel-programming/271499-splitting-data-cell.html)

Verne[_2_]

Splitting data in a cell
 
I have a spreadsheet that has a date and time in one
cell. I need to use this data to generate an SLA report
showing the time difference between the two. How do I
separate (strip) the two different data types so I can
analyze it to create my SLA reports?

Tom Ogilvy

Splitting data in a cell
 
dim dtDate as Date
dtDate = Int(Range("A1").Value)
msgbox format(dtDate, "mm/dd/yyyy")

By taking the integer part of the number you strip off the time.

in a worksheet formula

=Trunc(A1)
format the cell as date.

Regards,
Tom Ogilvy


Verne wrote in message
...
I have a spreadsheet that has a date and time in one
cell. I need to use this data to generate an SLA report
showing the time difference between the two. How do I
separate (strip) the two different data types so I can
analyze it to create my SLA reports?




Tom Ogilvy

Splitting data in a cell
 
Of couse the time would be
dim dtDate as Date
dim dtTime as Date
dtDate = Int(Range("A1").Value)
dtTime = Range("A1").Value - dtDate
msgbox format(dtDate, "mm/dd/yyyy") & " - " & _
format(dtTime,"hh:mm:ss")


=A1-trunc(a1) and format as time.
Regards,
Tom Ogilvy



Tom Ogilvy wrote in message
...
dim dtDate as Date
dtDate = Int(Range("A1").Value)
msgbox format(dtDate, "mm/dd/yyyy")

By taking the integer part of the number you strip off the time.

in a worksheet formula

=Trunc(A1)
format the cell as date.

Regards,
Tom Ogilvy


Verne wrote in message
...
I have a spreadsheet that has a date and time in one
cell. I need to use this data to generate an SLA report
showing the time difference between the two. How do I
separate (strip) the two different data types so I can
analyze it to create my SLA reports?







All times are GMT +1. The time now is 05:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com