Home

IF cell is coloured (any colour) count as 15 minutes and Sum as time durration

%3CLINGO-SUB%20id%3D%22lingo-sub-1126658%22%20slang%3D%22en-US%22%3EIF%20cell%20is%20coloured%20(any%20colour)%20count%20as%2015%20minutes%20and%20Sum%20as%20time%20durration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1126658%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20using%20Excel%20as%20a%20roster%20planner%20%2Ftimeline%20of%20events.%20Is%20it%20possible%20to%20get%20excel%20to%20look%20at%20a%20range%20of%20preceding%20cells%20in%20one%20row%20and%20count%20each%20coloured%20cell%20(colours%20need%20to%20be%20different%20ideally)%20as%20a%20duration%20of%2015mins%20then%20calculate%20total%20duration%20of%20the%20shift%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIdeally%20reporting%20start%20time%20and%20end%20time%20(which%20runs%20across%20the%20higher%20row)%20ie%3C%2FP%3E%3CP%3Edon't%20count%20columns%20A%2BB%20ever%20(headers)%3C%2FP%3E%3CP%3EDon't%20count%20rows%201%20-7%202%20ever%20(headers)%3C%2FP%3E%3CP%3Eif%20row%208%20row%20c%2Cd%2Ce%2C%20etc%20is%20a%20color%20count%20it%20as%2015%20mins%20and%20return%20result%20in%20row%208%2C%20Column%20AD%3C%2FP%3E%3CP%3Ein%20AE%20return%20time%20of%20row%202%20of%20the%20corresponding%26nbsp%3B%20first%20colored%20cell%20that%20row%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3Ein%20AF%20return%20time%20of%20row%202%20of%20the%20corresponding%26nbsp%3B%20last%20colored%20cell%20that%20row%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEnd%20result%20showing%20Shift%20duration%2C%20Start%20time%2C%20End%20Time.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eor%20is%20this%20just%20too%20tricky%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1126658%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1127109%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20cell%20is%20coloured%20(any%20colour)%20count%20as%2015%20minutes%20and%20Sum%20as%20time%20durration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1127109%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F530939%22%20target%3D%22_blank%22%3E%40Nickp84%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOnly%20Macro%20can%20help.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1138492%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20cell%20is%20coloured%20(any%20colour)%20count%20as%2015%20minutes%20and%20Sum%20as%20time%20durration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1138492%22%20slang%3D%22en-US%22%3EOK%20happy%20to%20learn%20and%20investigate%20more...%20can%20you%20suggest%20some%20term%20I%20can%20google..%3CBR%20%2F%3E%3CBR%20%2F%3EI've%20done%20a%20bit%20with%20Macros%20before%20but%20I'm%20v%20begginer...%20do%20you%20think%20I'll%20be%20on%20over%20my%20head%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1139078%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20cell%20is%20coloured%20(any%20colour)%20count%20as%2015%20minutes%20and%20Sum%20as%20time%20durration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1139078%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F530939%22%20target%3D%22_blank%22%3E%40Nickp84%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHave%20to%20agree%20with%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F425987%22%20target%3D%22_blank%22%3E%40mathetes%3C%2FA%3E%26nbsp%3B.%20Why%20try%20to%20calculate%20with%20colours.%20It%20is%20so%20much%20easier%20with%20numbers.%20I%20guess%20that%20someone%20is%20actually%20selecting%20the%20cells%20of%20the%20shift%20and%20giving%20it%20a%20color.%20He%2Fshe%20might%20as%20well%20enter%20the%20number%201%20and%20press%20Ctrl-Enter%20(on%20a%20Mac)%20and%20enter%20it%20in%20all%20selected%20cells%20simultaneously.%20If%20you%20then%20conditionally%20format%20the%20entire%20roster%2C%20all%20cells%20with%20%221%22%20can%20be%20given%20a%20highlight.%20And%20the%20summary%20you%20asked%20for%20(Start%2C%20Finish%20and%20Duration)%20is%20then%20fairly%20easily%20calculated%20in%20a%20formula.%20The%20attached%20workbook%20contains%20a%20small%20scale%20example.%20Perhaps%20you%20will%20reconsider%20your%20initial%20design%2Fapproach.%3C%2FP%3E%3CP%3EBy%20the%20way%2C%20I%20entered%20som%20helper%20rows%20at%20the%20top(hidden)%2C%20just%20to%20help%20me%20create%20the%20example.%20If%20you%20already%20have%20a%20row%20with%20all%20quarters%20in%20a%20time%20format%2C%20you%20may%20ignore%20these.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1138581%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20cell%20is%20coloured%20(any%20colour)%20count%20as%2015%20minutes%20and%20Sum%20as%20time%20durration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1138581%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F530939%22%20target%3D%22_blank%22%3E%40Nickp84%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20may%20be%20too%20tricky.%20My%20question%20is%20%22why%20the%20colors%20in%20the%20first%20place%3F%20And%20how%20do%20they%20get%20into%20the%20cells%20in%20question%3F%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20reason%20for%20asking%3A%20is%20there%20another%20way%20to%20start%20that%20same%20logic%20in%20action%20by%20using%20letters%20or%20something%20else%20other%20than%20colors%3F%20(i.e.%2C%20it%20sounds%20like%20you're%20trying%20to%20be%20tricky%2C%20or%20cool%2C%20with%20the%20colors%2C%20and%20in%20the%20process%20making%20it%20more%20difficult%20than%20it%20needs%20to%20be.%20Certainly%2C%20if%20a%20macro%20is%20needed%20to%20resolve%20this....)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20it%20possible%20for%20you%20to%20upload%20a%20sample%20(after%20removing%20any%20real%20names)%20of%20what%20it%20looks%20like%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Hello, 

 

I'm using Excel as a roster planner /timeline of events. Is it possible to get excel to look at a range of preceding cells in one row and count each coloured cell (colours need to be different ideally) as a duration of 15mins then calculate total duration of the shift? 

 

Ideally reporting start time and end time (which runs across the higher row) ie

don't count columns A+B ever (headers)

Don't count rows 1 -7 2 ever (headers)

if row 8 row c,d,e, etc is a color count it as 15 mins and return result in row 8, Column AD

in AE return time of row 2 of the corresponding  first colored cell that row  

in AF return time of row 2 of the corresponding  last colored cell that row 

 

End result showing Shift duration, Start time, End Time.

 

or is this just too tricky?

 

 

4 Replies
Highlighted
Highlighted
OK happy to learn and investigate more... can you suggest some term I can google..

I've done a bit with Macros before but I'm v begginer... do you think I'll be on over my head?

Highlighted

@Nickp84 

 

It may be too tricky. My question is "why the colors in the first place? And how do they get into the cells in question?"

 

The reason for asking: is there another way to start that same logic in action by using letters or something else other than colors? (i.e., it sounds like you're trying to be tricky, or cool, with the colors, and in the process making it more difficult than it needs to be. Certainly, if a macro is needed to resolve this....)

 

Is it possible for you to upload a sample (after removing any real names) of what it looks like?

 

Highlighted

@Nickp84 

Have to agree with @mathetes . Why try to calculate with colours. It is so much easier with numbers. I guess that someone is actually selecting the cells of the shift and giving it a color. He/she might as well enter the number 1 and press Ctrl-Enter (on a Mac) and enter it in all selected cells simultaneously. If you then conditionally format the entire roster, all cells with "1" can be given a highlight. And the summary you asked for (Start, Finish and Duration) is then fairly easily calculated in a formula. The attached workbook contains a small scale example. Perhaps you will reconsider your initial design/approach.

By the way, I entered some helper rows at the top (hidden), just to help me create the example. If you already have a row with all quarters in a time format, you may ignore these.

Related Conversations
Time and Yes/No
Rob Nunley in SharePoint on
0 Replies
Counting Days
Tim Hunter in SQL Server on
2 Replies
How to count multiple values in a cell
Ugarte335 in Excel on
7 Replies
Count until
MBelshaw in Excel on
1 Replies
Pivot table
gabriellerocha in Excel on
5 Replies
Add Column Using Count
Tim Hunter in SQL Server on
0 Replies