I need to calculate the difference in hours:minutes between two dates:hours:minutes. I attached a sample data. I simply deducted start date (column A - ) from end date (column B) and used a custom formatting in column C, such as "h:mm". I need to sort the "hours:minutes" difference from the smallest to largest.

I have two problems that I cannot resolve.

ColumnA ColumnB ColumnC
2/20/2016 23:58 2/22/2016 10:15 10:16


1. When I deducted =B2-B1 in column C, it returns incorrect hour difference if the date/time difference is greater than 24 hours. The formula seems doesn't account for the dates but only for hours and minutes.
2. When I sort from small to large, it sorts from small to large only in two ranges: rows 2-25 (in yellow) and rows 26-97 (not highlighted).

Any help would be greatly appreciated!