Gantt chart for time sheet formulae working only 1st row

%3CLINGO-SUB%20id%3D%22lingo-sub-2015637%22%20slang%3D%22en-US%22%3EGantt%20chart%20for%20time%20sheet%20formulae%20working%20only%201st%20row%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2015637%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%20and%20seasons%20greetings.%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%20I%20have%20taken%20a%20formula%20suggested%20from%20google%20to%20make%20a%20gantt%20chart%20for%20my%20employees%20roster%20time%20sheet%2C%3C%2FP%3E%3CP%3EIF(%24B5%26lt%3B%24C5%2CAND(D%244%26gt%3B%3D%24B5%2CD%244%26lt%3B%3D%24C5)%2COR(D%244%26gt%3B%3D%24B5%2CD%244%26lt%3B%24C5))%3C%2FP%3E%3CP%3EPlan%20was%20in%20cell%20B5%20put%20this%20into%20conditional%20formatting%20then%20drag%20to%20cover%20all%20cells.%20This%20works%20for%20the%20first%20row%20but%20doesn't%20when%20dragging%20down.%20The%20finish%20time%20works%20but%20the%20start%20doesn't...%20Have%20tried%20to%20fix%20myself%20but%20can't%20work%20out%20why....%26nbsp%3B%3C%2FP%3E%3CP%3ESample%20below.%20Have%20been%20working%20on%20some%20other%20stuff%20related%20so%20it%20has%20got%20some%20random%20experiment%20formulas%20round%20the%20place....%3C%2FP%3E%3CP%3EAny%20thoughts%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2015637%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2015690%22%20slang%3D%22en-US%22%3ERe%3A%20Gantt%20chart%20for%20time%20sheet%20formulae%20working%20only%201st%20row%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2015690%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F345048%22%20target%3D%22_blank%22%3E%40Cambosity%3C%2FA%3E%26nbsp%3BOn%20row%2024%2C%20columns%20BA%3ADB%2C%20your%20SUM%20formula%20includes%20the%20row%20that%20contains%20the%20shift%20number%20for%20every%20other%20column.%20Copy%20the%20formula%20from%20AZ24%20across%20and%20it%20shall%20work.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2015806%22%20slang%3D%22en-US%22%3ERe%3A%20Gantt%20chart%20for%20time%20sheet%20formulae%20working%20only%201st%20row%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2015806%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F345048%22%20target%3D%22_blank%22%3E%40Cambosity%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnother%20way%20how%20to%20fix%20what%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3Bexplains%3C%2FP%3E%0A%3CP%3E-%20in%20Start%20%2F%20End%20columns%20instead%20of%20%3DAZ24%20use%26nbsp%3B%3DMOD(AZ24%2C1)%3C%2FP%3E%0A%3CP%3E-%20Formula%20for%20conditional%20formatting%20rule%20I'd%20adjust%20as%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3D(D%244%26gt%3B%3DMEDIAN(D%244%2C%24B5-1%2F10000%2C%24C5%2B1%2F10000))*(D%244%26lt%3B%3DMEDIAN(D%244%2C%24B5-1%2F10000%2C%24C5%2B1%2F10000))*(%24C5%26gt%3B%24B5)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Eto%20exclude%20not%20defined%20shifts%20and%20fix%20possible%20rounding%20errors%20in%20time%20calculations%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi all and seasons greetings. I have taken a formula suggested from google to make a gantt chart for my employees roster time sheet,

IF($B5<$C5,AND(D$4>=$B5,D$4<=$C5),OR(D$4>=$B5,D$4<$C5))

Plan was in cell B5 put this into conditional formatting then drag to cover all cells. This works for the first row but doesn't when dragging down. The finish time works but the start doesn't... Have tried to fix myself but can't work out why.... 

Sample below. Have been working on some other stuff related so it has got some random experiment formulas round the place....

Any thoughts?

4 Replies

@Cambosity On row 24, columns BA:DB, your SUM formula includes the row that contains the shift number for every other column (the ones with the start times). Change the values on row 24 to type General and you see the consequences. For instance, column BB shows a total of 2.5, being the shift number plus the number value of the time 12:00 (i.e. 0.5 of 1 day). Formatting the number 2.5 as h:mm will display 12:00 as Excel only displays the time portion of 2.5 days. Copy the formula from AZ24 across and it shall work.

@Cambosity 

Another way how to fix what @Riny_van_Eekelen explains

- in Start / End columns instead of =AZ24 use =MOD(AZ24,1)

- Formula for conditional formatting rule I'd adjust as

=(D$4>=MEDIAN(D$4,$B5-1/10000,$C5+1/10000))*(D$4<=MEDIAN(D$4,$B5-1/10000,$C5+1/10000))*($C5>$B5)

to exclude not defined shifts and fix possible rounding errors in time calculations

@Sergei Baklan 

Sorry for the slow reply I have been away for some time. Your formula works beautifully.... Thankyou ! and Happy New Year !

@Riny_van_Eekelen 

Thankyou and sorry for my slow reply. I have been away. I decided to use the formula from Sergei and does well !! Happy New Year !