Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Date Diff Help

Dear All,

A B C D E
Date Time Date Time Output
04.07.08 9:18:56 AM 01.08.08 7:41:33 PM
04.08.08 9:18:56 PM 01.08.08 7:41:33 PM
24.08.08 10:05:03 AM 22.08.08 12:13:30 PM

Check date time in column A, B, C & D if date & time of column C & D is
greater that date time of column A & B I should get "No" else "Yes" in column
E.

TIA
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default Date Diff Help

This should work for you. This macro will run down rows 2 thru last row in
Col.A

Option Explicit

Sub TestDates()

Dim i As Long

For i = 2 To Cells(Rows.Count, "A").End(xlUp).Row
If (Cells(i, "A").Value And Cells(i, "B").Value) < _
(Cells(i, "C").Value And Cells(i, "D").Value) Then
Cells(i, "E").Value = "Yes"
Else
Cells(i, "E").Value = "No"
End If
Next i

End Sub

Hope this helps! If so, please click "YES" below.
--
Cheers,
Ryan


"kiran" wrote:

Dear All,

A B C D E
Date Time Date Time Output
04.07.08 9:18:56 AM 01.08.08 7:41:33 PM
04.08.08 9:18:56 PM 01.08.08 7:41:33 PM
24.08.08 10:05:03 AM 22.08.08 12:13:30 PM

Check date time in column A, B, C & D if date & time of column C & D is
greater that date time of column A & B I should get "No" else "Yes" in column
E.

TIA

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
(date diff.) A2-A1=#value! ? Boswell Excel Worksheet Functions 3 August 28th 06 02:22 PM
date in diff. cells Gerald Excel Discussion (Misc queries) 3 July 23rd 06 09:47 AM
Excel 97 date diff [email protected] Excel Worksheet Functions 3 January 19th 06 02:49 PM
date (minus) date = working days diff jjj Excel Discussion (Misc queries) 3 December 6th 05 03:16 PM
Date Diff Chip Pearson Excel Discussion (Misc queries) 1 October 25th 05 07:53 PM


All times are GMT +1. The time now is 09:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"