Extracting Data from Table and rounding times to nearest hour / half hour

SimonVOwen

New Member
Joined
Nov 15, 2017
Messages
26
Hello All,

I want to be able to separate out this data and allocate it to daily HH segments.
For example ideally I would be able to pull out the data in B3 (16:00-19:59)
To show 16:00 and 20:00. And then multiple these values by 2.
As this data sett would fall between the 33rd and 40th half hour periods of the day. (this is 8 half hours segments)
I know I can individually code this pretty easy but was trying to utilise Left/Right with round() to pull out the data but round on 19:59 does not round to 20.

I need to use the same formula on 13 different data sheets in a standardized format ideally that could quickly pull out the half hours timings present in each Period.

Time periodsPeriod 1Period 2Period 3Period 4Period 5
Winter PeakSummer PeakWinter ShoulderNightOther
Monday to Friday
November to February
16:00 - 19:59 07:00 - 15:59
Monday to Friday
June to August
07:00 - 19:59
Monday to Friday
March
07:00 - 19:59
All Year 00:00 - 06:59All Other Times

<tbody>
</tbody><colgroup><col span="2"><col span="5"></colgroup>
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Try this

Code:
[COLOR=#d3d3d3]'[/COLOR]
[COLOR=#0000cd]=TEXT((ROUND(LEFT(B3,5)*24,0)/24),"HH:MM") & " - " & TEXT((ROUND(RIGHT(B3,5)*24,0)/24),"HH:MM")
[/COLOR][COLOR=#d3d3d3]'[/COLOR][COLOR=#0000cd][/COLOR]
 
Upvote 0

Forum statistics

Threads
1,215,599
Messages
6,125,751
Members
449,258
Latest member
hdfarid

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