cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Calculated working hours

Hi,

 

I have a calculated field that calculates how many hours an employee has been working.

hours.PNG

The formula is:

=IF([Time Out]="","0",TEXT([Time Out]-[Time In],"h"))

 

I'd like to add 2 conditions to it; I could do this in separate columns but I'd like to have it as one formula.

Basically, I need to deduct breaks time so IF Hours per Shift < 11.5 then -0.5h and IF Hours per Shift > 11.5 then -1.5h

 

How I can put in in one formula?

 

Thank you.

 

Slawek

3 REPLIES 3
Highlighted

Re: Calculated working hours

Hi @TheSlawekG 

 

Is this really a Flow problem? It looks like you are doing this all in SharePoint.  Why not simply add a break in and a break out field and then include this in your calculation.

Highlighted
Dual Super User II
Dual Super User II

Re: Calculated working hours

Hi @TheSlawekG 

 

MS Flow will not be able to understand calculate columns because they are calulcated at run time

You would first have to perform the same calculatation as your calculated column in Flow

 

In your case you would have to compare 2 dates to get the difference in hours

 

Check my blog post on how to do this in Flow

https://powerusers.microsoft.com/t5/Microsoft-Flow-Community-Blog/Flow-Calculate-Date-Diference/ba-p...

 

Next once you get the differnece

You cna use a simple if expresison to compare the dates and accordingly add or subtract your 30 mins and 1.5 hrs

 

use addminutes function to do so

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Highlighted
Helper I
Helper I

Re: Calculated working hours

Hi,

 

thank you for your reply Guys.

 

I'm working on a Flow using this SP List and by mistake, I published my question here.

 

Cheers.

 

Slawek

Helpful resources

Announcements
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (5,860)