Comparing Dates

poucedeleon

New Member
Joined
Oct 11, 2011
Messages
6
I have been tasked with moving data from a sharepoint calendar into a new training database. I am trying to identify all the rows that have more than one day. The following is an example of the format. The top three are multiple days, where the bottom row is one day. I would like to know if there is a conditional format that will identify the mutiple day rows. The single days will import fine, but I need to create seperate rows for all of the mutiple day rows, and I have about 3000 rows, so I am looking for a way to target just the rows that need work.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Training ID
[/TD]
[TD]Name
[/TD]
[TD]Start Date
[/TD]
[TD]End Date
[/TD]
[/TR]
[TR]
[TD]093540
[/TD]
[TD]MIELE
[/TD]
[TD]2/10/2014 0:00
[/TD]
[TD]2/11/2014 23:59
[/TD]
[/TR]
[TR]
[TD]110610
[/TD]
[TD]MOORMEIR
[/TD]
[TD]2/10/2014 0:00
[/TD]
[TD]2/12/2014 23:59
[/TD]
[/TR]
[TR]
[TD]030621
[/TD]
[TD]CORNELL
[/TD]
[TD]2/11/2014 0:00
[/TD]
[TD]2/15/2014 23:59
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]048370
[/TD]
[TD]LARKIN
[/TD]
[TD]2/11/2014 0:00
[/TD]
[TD]2/11/2014 23:59
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
I have been tasked with moving data from a sharepoint calendar into a new training database. I am trying to identify all the rows that have more than one day. The following is an example of the format. The top three are multiple days, where the bottom row is one day. I would like to know if there is a conditional format that will identify the mutiple day rows. The single days will import fine, but I need to create seperate rows for all of the mutiple day rows, and I have about 3000 rows, so I am looking for a way to target just the rows that need work.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Training ID[/TD]
[TD]Name[/TD]
[TD]Start Date[/TD]
[TD]End Date[/TD]
[/TR]
[TR]
[TD]093540[/TD]
[TD]MIELE[/TD]
[TD]2/10/2014 0:00[/TD]
[TD]2/11/2014 23:59[/TD]
[/TR]
[TR]
[TD]110610[/TD]
[TD]MOORMEIR[/TD]
[TD]2/10/2014 0:00[/TD]
[TD]2/12/2014 23:59[/TD]
[/TR]
[TR]
[TD]030621[/TD]
[TD]CORNELL[/TD]
[TD]2/11/2014 0:00[/TD]
[TD]2/15/2014 23:59[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]048370[/TD]
[TD]LARKIN[/TD]
[TD]2/11/2014 0:00[/TD]
[TD]2/11/2014 23:59[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Select Column C and D from Row 2 on down to the last row you ever expect to have data in, then call up the Conditional Formatting dialog box and use this formula for the condition...

=INT($C2)<>INT($D2)
 
Upvote 0
Rick, would it be asking to much to have you explain the formula. I think I understand part of it. <> looks to see if the data in the cells are equal, but I don't know what the $ sign does and I am not familiar with "INT"
=INT($C2)<>INT($D2)
 
Upvote 0
Rick, would it be asking to much to have you explain the formula. I think I understand part of it. <> looks to see if the data in the cells are equal, but I don't know what the $ sign does and I am not familiar with "INT"
=INT($C2)<>INT($D2)
Dates, to Excel, are floating point numbers (the date format you see is only for the convenience of the human viewer)... the integer part is the number of days offset from some "date zero", so Jan 1, 1900 is offset 1, Jan 2, 1900 is offset 2, on up to today (Feb 21, 2014) which is offset 41691... the decimal part is the fraction of a 24-hour day that the time part of the date represents. Since you showed the dates with times, it was necessary to remove the time part for the comparison... the INT function removes the decimal part of a positive floating point value.
 
Upvote 0
Dates, to Excel, are floating point numbers (the date format you see is only for the convenience of the human viewer)... the integer part is the number of days offset from some "date zero", so Jan 1, 1900 is offset 1, Jan 2, 1900 is offset 2, on up to today (Feb 21, 2014) which is offset 41691... the decimal part is the fraction of a 24-hour day that the time part of the date represents. Since you showed the dates with times, it was necessary to remove the time part for the comparison... the INT function removes the decimal part of a positive floating point value.

Again, Thank you that was very helpful!!!
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,874
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top