Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel time compare

Status
Not open for further replies.

matpj

Technical User
Mar 28, 2001
687
0
0
GB
I am using MS Excel 2000
I have two columns: start date and end date (dd/mm/yy hh:mm:ss)

What I need to do is on all rows, compare the end date with the start date of the row below it.
I would then need something to appear or flag up if the end date is before the start date of the next row.

Does this capability exist within Excel? is there a compare function, and a criteria function to enable some text to be entered?

any help would be appreciated.

Thanks

Matt
 
A "conditional format" function is available in Excel to allow you to achieve what you are trying to. You can use a number a of functions (such as DATE) to perform the comparison and change a cell to a specific colour if the result meets a defined criteria.

Let me know if you want some help to construct the formulas.
 
If I understand you correctly, you can do it with an if statement. Lets say "a1" has your first start date and "b1" your first end date. In C1 put the formula =if(b1>a2,"Error","") and drag it down the column (Where "error" is what ever you want to use to flag a start date that occurs before the previous end date). Excel stores dates and times as serial numbers 1234.5664 which is the number of days from 1/1/1900. The decimal portion is the fraction of the day, which is the time. I hope this helps you out
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top