cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TimoMigchielsen
Post Prodigy
Post Prodigy

Calculate with times

Hello!

So I am calculating the time between 2 times using 4 dropdown boxes. The time is being displayed like this:

https://gyazo.com/c85df24cfc1d1b80e6c0372d8a9a5fac

I then have another dropdown box where they can select the pause they had. This will be in minutes (15, 30, 45, 60)

I then want to calculate the tijd totaal - the pause in minutes

How could I do this? 

Code Tijd totaal: 

DateDiff(Time(
Value(DropBeginUur.Selected.Value),
Value(DropBeginMinuten.Selected.Value),
0),Time(
Value(DropEindUur.Selected.Value),
Value(DropEindMinuten.Selected.Value),
0),Minutes) / 60.0

The dropdown for pause is named DropPause


1 ACCEPTED SOLUTION

Accepted Solutions

Hi @TimoMigchielsen ,

 

 

Please try this:

(DateDiff(Time(
Value(DropBeginUur.Selected.Value),
Value(DropBeginMinuten.Selected.Value),
0),Time(
Value(DropEindUur.Selected.Value),
Value(DropEindMinuten.Selected.Value),
0),Minutes)-Pause.Selected.Value) / 60.0

Pause.Selected.Value means the pause minutes you selected from pause dropdown.

Sik

 

View solution in original post

4 REPLIES 4
mdevaney
Super User
Super User

@TimoMigchielsen 

You would seem to have a valid formula.  What has gone wrong?  Please provide an example of what you input, what the output was, and what the answer should be.

 

Why did you divide by 60 at the end of the formula?  You can control the 'Units' in the 3rd argument of DATEDIFF so this seems unnecessary.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

I did not make that code myself but it basically calculates the time between 4 dropdownboxes. This code works totally fine. Here is an example: https://gyazo.com/ae308ba31c8fb5e89a6e27bd6e44b526

Now I want to have another textfield that calculates the time - the pause. 

Now for an example I have added another dropdownbox that is named pause. So I need to add another textfield where the time - the pause is stated. 

Now the total time = 7.25 which is equal to 7 hours and 15 minutes. The pause dropdown box is 30 minutes, so the time in the new textfield should be: 6.75

I hope this made it more clear. @mdevaney 

Anyone able to help me?

Hi @TimoMigchielsen ,

 

 

Please try this:

(DateDiff(Time(
Value(DropBeginUur.Selected.Value),
Value(DropBeginMinuten.Selected.Value),
0),Time(
Value(DropEindUur.Selected.Value),
Value(DropEindMinuten.Selected.Value),
0),Minutes)-Pause.Selected.Value) / 60.0

Pause.Selected.Value means the pause minutes you selected from pause dropdown.

Sik

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,802)