Hey all again!
I have two labels with Text. For example "03:16" and "00:06".
Now i want to calculate A-B="03:10". How i can do this?
I want to calculate with the Result too. In further functions i want to sum all worktime of a week.
I want to build a little Timetracker. Calculate with date and time oder sharepoint is really horrible 😞
Thanks!
Solved! Go to Solution.
Hi @CPKH
The following function will provide the difference in minutes between the 2 times. In this example, the result will be 190.
DateDiff(TimeValue("00:06"),TimeValue("03:16"), Minutes)
In your case, you can refer to your labels, rather than use hardcoded values.
You can then use this with the formula in your other post to display the duration in hh:mm format.
RoundDown(DateDiff(TimeValue("00:06"),TimeValue("03:16"), Minutes)/60,0) & ":" & Text(Mod(DateDiff(TimeValue("00:06"),TimeValue("03:16"), Minutes),60), "00")
If you post some additional details about your summing requirements, we can provide some more specific help.
Hi @CPKH
The following function will provide the difference in minutes between the 2 times. In this example, the result will be 190.
DateDiff(TimeValue("00:06"),TimeValue("03:16"), Minutes)
In your case, you can refer to your labels, rather than use hardcoded values.
You can then use this with the formula in your other post to display the duration in hh:mm format.
RoundDown(DateDiff(TimeValue("00:06"),TimeValue("03:16"), Minutes)/60,0) & ":" & Text(Mod(DateDiff(TimeValue("00:06"),TimeValue("03:16"), Minutes),60), "00")
If you post some additional details about your summing requirements, we can provide some more specific help.
It works perfectly! thanks!
Could u answer me, why we have to use mod() for the minutes "00:XX". I don't undertstand that part.
I was confused... i first tried
TimeValue("00:06") and thats "12:06 AM"
So i thought i cannot take it, because now its a real time and not just a number in a time format i can calculate with.
Thats all at the moment, thanks for your help!
Hi @CPKH
Glad that works for you.
The Mod function returns the remainder after the division of 2 numbers.
Taking the example of 190 minutes...
Mod(190, 60) = 10
60 goes into 190 3 times, with 10 left over. This 10 value provides us with the minute component of 03:10.
Hope that makes sense to you!
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.
User | Count |
---|---|
203 | |
106 | |
56 | |
51 | |
41 |
User | Count |
---|---|
267 | |
156 | |
83 | |
81 | |
56 |