Filling in the gaps

n1lesh

Board Regular
Joined
Apr 3, 2015
Messages
61
i was wondering if some one could help me with the following problem and thanks in advance

TIME20:0021:0022:0023:0000:0001:0002:0003:0004:0005:0006:0007:0008:00
21:0022:0023:0000:0001:0002:0003:0004:0005:0006:0007:0008:0009:00
START FINISH
22:1006:0000:1001:0001:0001:0001:0001:0001:0001:00
20:2507:2000:2501:0001:0001:0001:0001:0001:0001:0001:0001:0001:0000:20

<colgroup><col width="72" span="17" style="width:54pt"> </colgroup><tbody>
</tbody>

i have been tasked to fill out the following sheet i hope i can explain it to you:
i am looking for a formula that will out this sheet for me

for example 1 some one starts at 22:10 so in the time column i have to enter in 00:10 mins from 22:00-23:00
they finish at 6:00 so i have to enter in 1:00 in the column 05:00-06:00
all the rows in between have 01:00 in them as they are at work

i have thousands of these lines to fill out and was wondering if there was a formula to help me with this preferably not VBA
Again thanks in adavance if this is possible
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Try this.

Top left cell is A1.
TIME20:0021:0022:0023:0000:0001:0002:0003:0004:0005:0006:0007:0008:00
21:0022:0023:0000:0001:0002:0003:0004:0005:0006:0007:0008:0009:00
STARTFINISH
22:1006:1000:1001:0001:0001:0001:0001:0001:0001:0000:10
20:2507:2000:2501:0001:0001:0001:0001:0001:0001:0001:0001:0001:0000:20

<tbody>
</tbody>

In E4, copied to the left and downward:
=IF(HOUR($A4+4/24)=HOUR(E$1+4/24),$A4-E$1,IF(HOUR($B4+4/24)=HOUR(E$1+4/24),$B4-E$1,
IF(AND(HOUR($A4+4/24)< HOUR(E$1+4/24),HOUR($B4+4/24)>HOUR(E$1+4/24)),TIME(1,0,0),"")))
 
Last edited:
Upvote 0
I looked at this again. In the first row, should the time difference be 00:50 in the 22:00 to 23:00 hour—start at 22:10 and end at 23:00 equals 50 minutes?
Working from 20:25 to 21:00 in column E should be 35 minutes? If so, try this.

=IF(HOUR($A4+4/24)=HOUR(E$1+4/24),TIME(1,0,0)-TIME(0,MINUTE($A4),0),IF(HOUR($B4+4/24)=HOUR(E$1+4/24),$B4-E$1,
IF(AND(HOUR($A4+4/24)< HOUR(E$1+4/24),HOUR($B4+4/24)>HOUR(E$1+4/24)),TIME(1,0,0),"")))
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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