cancel
Showing results for
Did you mean:
Anonymous
Not applicable

## 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
Community Support

Hi @Anonymous ,

``````(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

4 REPLIES 4
Super User

@Anonymous

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."

Anonymous
Not applicable

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

Anonymous
Not applicable

Anyone able to help me?

Community Support

Hi @Anonymous ,

``````(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

Announcements

#### Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

#### Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

#### New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,293)