# Compare times and plot time range

#### linga

##### New Member
Dear all

Start time in column A, and End time in Column B , need to compare the time between cells and plot the time range. with 30 min interval.

EX:
 DTS_START DTS_END Range 2020-12-01 07:00:35 2020-12-01 07:10:27 7-7.30

Excel file attached for reference,

Regards,
Linganathan.U

#### vletm

##### Excel Ninja
linga
Of course, Your missing file has more rows than ... one.
... as well as there would be shown expected results too.

#### pecoflyer

##### Active Member
And also
Our answerers are looking to "help" more often than they are looking to "do an entire project for you for free".
Jump into this project yourself, when you get stuck on ONE specific hurdle, post that ONE item as a forum question.
Show us what you've tried in an attached sample workbook and how it's not working for you. When you're doing the work yourself, just writing out a complete example question in a forum often points you to solution before you even finish posting.

#### GraH - Guido

##### Well-Known Member
Maybe this is working?
=TEXT(TIME(HOUR(A2),0,0),"hh:mm")&" - "&TEXT(MOD(CEILING(B2,TIME(0,30,0)),1),"hh:mm")

#### pecoflyer

##### Active Member
And your date/time is left aligned? Is this manual alignment or not? If the latter, then it is text looking like date/time

#### linga

##### New Member
Sir,

The formula has met the requirement , thank you very much

Regards,
Linganathan.U

#### GraH - Guido

##### Well-Known Member
Sir,
The formula has met the requirement , thank you very much
Regards,
Linganathan.U
Glad to help, and thanks for the feedback, but maybe I was a bit too quick and the formula needs some tweaking.
= TEXT(MOD(FLOOR(A2,TIME(0,30,0)),1),"hh:mm") &" - "& TEXT(MOD(CEILING(B2,TIME(0,30,0)),1),"hh:mm")

So it starts within a half hour time frame as well. Like 7:45 to 9:59 is in the range 7:30 - 10:00