cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
TheSlawekG
Level: Powered On

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
Super User
Super User

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.

Dual Super User
Dual Super User

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

TheSlawekG
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,359)