(Aug-21-2022, 05:48 AM)CynthiaMoore Wrote: Is that any clearer?
Yes, very much so. Thank you.
I would like to be able to offer you a Python based solution, but given that I can't and that I think that you can do what you want to do, using a custom style sheet, I offer this:
You'd need to create a new style sheet, with a new style for each duration.
On the new style sheet, create a style called
minutes
for which the format code could be (for example):
MM:SS" (Mins:Sec)"
... and a style for
hours
for which the format code could be (again, for example):
HH:MM" (Hrs:Min)"
... and so on, for each time period.
The standard format code (for any given cell) would be
SS" (Sec)"
with conditional format, for which the rule is...
Condition 1:
Cell value between 0.00069540 and 0.04166605 Apply style minutes
Condition 2:
Cell value between 0.04167764 and 0.99999679 Apply style hours
... and so on, again, for each time period. If your cells will only ever hold any given time period, then you need only one condition for said cell, but if your cells can hold any given time period, then you'll need as many conditions as there are time periods.
This could read as more complicated than it is in fact; the real work involves (as with any programming project) designing the rules and applying them, but I'm sure that it can be done.
This is all VBA, behind the curtain, but you're using Excel as a 'front-end', if you will.
n.b: the values I have here are:
0.04166605 = 00:59:59
0.99999679 = 23:59:59