Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a worksheet with data that has a time column with the following format:
5/12/2006 1:52:00 PM All of this is in one cell. I'm trying to do two things: read from cell to cell and identify when the difference is greater than 30 seconds. Then when that condition is met I would like to subtract the two and get the time between. Your help would be greatly appreciated. Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use a formula like this
=IF((A2-A1)TIME(0,0,30),A2-A1,"") ensure that the formula cell is formatted as [h]:mm:ss -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "joshroberts" wrote in message ... I have a worksheet with data that has a time column with the following format: 5/12/2006 1:52:00 PM All of this is in one cell. I'm trying to do two things: read from cell to cell and identify when the difference is greater than 30 seconds. Then when that condition is met I would like to subtract the two and get the time between. Your help would be greatly appreciated. Thanks. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You just need to subtract the values. If they're greater than 30
seconds, do something with them: Const d30Sec As Double = #0:00:30# Const nCOL As Long = 1 'column number Dim i As Long Dim dDiff As Double For i = 1 To Cells(Rows.Count, nCOL).End(xlUp).Row - 1 dDiff = Cells(i + 1, nCOL).Value - Cells(i, nCOL).Value If dDiff d30Sec Then 'do something End If Next i In article , joshroberts wrote: I have a worksheet with data that has a time column with the following format: 5/12/2006 1:52:00 PM All of this is in one cell. I'm trying to do two things: read from cell to cell and identify when the difference is greater than 30 seconds. Then when that condition is met I would like to subtract the two and get the time between. Your help would be greatly appreciated. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dealing with #VALUE! | Excel Discussion (Misc queries) | |||
dealing with time | Excel Worksheet Functions | |||
Dealing with +/- Values, Need Help | Excel Worksheet Functions | |||
dealing with a projection | Charts and Charting in Excel | |||
Dealing with pop-ups | Excel Programming |