// Calculate total days, hours, and minutes
Set(varDays, RoundDown(varNoTicks / 864000000000, 0));
Set(varRemainingTicksAfterDays, Mod(varTicksDifference, 864000000000));
Set(varHours, RoundDown(varRemainingTicksAfterDays / 36000000000, 0));
Set(varRemainingTicksAfterHours, Mod(varRemainingTicksAfterDays, 36000000000));
Set(varMinutes, RoundDown(varRemainingTicksAfterHours / 600000000, 0));Set(varFormattedDuration,
If(
varDays > 0,
varDays & " days " & varHours & " hours " & varMinutes & " minutes",
If(
varHours > 0,
varHours & " hours " & varMinutes & " minutes",
varMinutes & " minutes"
)
)
);
For your first point, you can define the formula to calculate duration in one place, like a helper variable or a hidden control. Then, instead of writing the same formula multiple times, you just use that single variable or control wherever you need the duration.
For your second point, you need to match the current status (after removing spaces) with the correct column. You can check which stage matches the current status and calculate the time for that stage. If the current stage is still active (like "For Counter Signature"), you calculate the duration from the last modified time to now. This ensures you dynamically get the right stage and show its duration
With()
statementvarNoTicks
with your input parameter or variable name containing ticks, use this function as part of your gallery items formula for duration labels.Substitute(ThisItem.CurrentStatus, " ", "")
. For calculating the time difference between the current date and a previous version’s modified date, usevarNoTicks
, PrevoiuseVersionModified
) with your actual data source fields or variables. This will format the durations and dynamically compute the current status duration
WarrenBelz
89
Most Valuable Professional
MS.Ragavendar
58
Michael E. Gernaey
42
Super User 2025 Season 1