IF formula in Excel to calculate demurrage charges (Logistics) - excel

I hope someone can help with with a question on IF formula in Excel. I am trying to calculate demmurage charges for logistic purposes, but I cannot get the formula to come out right. I will set the table below.
Driver has a 08:00 appointment and arrives on time. He has two free hours of load time prior to charging "wait" time. Driver is completed at 10:30, accumulating demurrage. I want the formula to tell me if the driver accrued detention charges.
IF(departure time) is greater than (appointment time)+2 hours "detention"

UPDATED:
=IF(ABS(A2-B2)<=2,"no","detention")
Column A = Appointment Time
Column B = Departure Time
I tried and attached is the screenshot for your reference. Let me know if its helpful.

Related

Formulas in Excel Pivot calculating custom fields

I have been stuck for a long time with this issue and so far I just calculate this manually.
Problem: For weekly statistics, I need to calculate the first 2 days (weekly) of absent hours. If the person was absent for more than 2 days, he has been replaced by another worker and is not included in said weekly statistics report.
This is a pivot table where yellow values need to be automated.
Thank you so much for any help!

Calculate minutes in specific period

I have a spreadsheet which has employee working times, listed as Sat-In and Sat-Out for a specific date. The employee shift spans several ours and each "In-Out" period is recorded as a separate line which means the time between the Sat-Out and the next Sat-In means the employee is on a break. I also calculate the time, in minutes of each "sitting" period.
What I can't seem to figure out is how to add a formula which takes the data and further refines it in this manner:
1. I have a core period of 1030-1530, as an example, which is the busy time and requires the maximum employee coverage. The shifts of employees generally spans this core, but in some cases their shift may start or end in the core.
2. I want to calculate how many minutes the employee worked within the core only. I can obviously do this manually using the data, but a formula would be preferred, if possible.
3. As an example, if a person sat-in at 1445 and sat-out at 1545, the core time calculation would be 45 minutes (1445-1530).
I've attached a snapshot of the data to help my explanation.
FYI - the information is pulled from a database as JSON data and converted to excel. I'm not very familiar with JavaScript, but if someone knows a way to do it programatically, I'm willing to give it a try and learn.
Thanks!
![excel]: https://photos.app.goo.gl/dRSTE72CXNa18RzP8
In below example I've used: =MAX(0,MIN($O$2,H2)-MAX($O$1,G2)), and formatted like [mm].
In Excel, units are days, so if you want to calculate the amount of minutes between two timestamps, you need to subtract both and multiply the differencee by 24*60 (being the amount of minutes in one day).
E.g. You start working at 09:07 (cell B2), and finish at 18:07 (cell B3), having a 45-minutes break. Then the time you worked in minutes, is:
=(B3-B2)*24*60-45
Make sure the cell formatting is correct (general), you'll get : 495.

Cognos Report totaling hours over time

I'm pretty new to Cognos 10 Report Studio so this may be a fairly simple question but I have been unable to find on answer so far.
In my database I have the hours a person has worked in a two week pay period, as well as what month a pay period exists in. I would like to total the over any period of months.
For example a user is prompted to choose a range of time, and they may select a start month of January of some year, and an end date of June of the same or some later year, and then the report would have a column that displays the sum of hours worked by a person between that time frame.
So in essence the sum of hours for every pay period in a given range of dates.
Thank you very much for your help.
If you want a list (or crosstab) with the User, year, month, and total hours in each month
Create a new data item (maybe something called - Hours by Month) defined as:
total([hours] for [Year], [Month], [User])
The function allows you to define the scope so the SQL is structured to give you the answer grouped the way you want

Select pay rate based on day and shift start time

Im creating an excel pay sheet so i can keep tabs on my pay.
I have two pay rates,
£9.30 is paid for hours worked from 6pm to 8am Monday to Thursday
£10.30 is paid for hours worked from 6pm Friday to 8am Monday.
I have a column that displays the pay rate, i want this to populate automatically with excel looking at the day of the week and then the start time and then returning the correct pay rate.
For example,
If the day is a Mon and the start time is 6pm return £9.30
If the day is Fri and the start time is 6pm return £10.30 etc etc
Any one have any ideas on how i can achieve this? Id rather this be formula based instead of VBA if possible but if it cant be formula based then VBA it is.
Thanks in advance
I had to make a few assumptions because your question was unclear about the possible start times for your shifts. Your wording and examples lead me to believe that your shifts always begin at 6 PM regardless of the day. I created a possible solution or start to a solution based on that assumption that does not rely on VBA. I've included links to an excel workbook with my solution and a screen shot. (I'm only allowed 2 links with my current rep.)
As Gowtham Shiva suggested in the comments, a screen shot of what you have so far would be helpful.
I created two tables and a named ranged called “valDays”. To use the workbook, you enter the date and start time for your shift in tblPay. Enter the pay rate for a specific day and time in tblRates. valDays provides a way to convert the text for a day of the week into a number for calculating date/time serial numbers.
Feel free to comment/message me for clarification. I’ll do my best to reply and refine the solution as necessary. I hope you find this answer helpful and appreciate feedback. This is my first time providing an answer on Stack Overflow.
I’m going to assume you know how to name a range, create tables, and rename tables in excel. If you don’t there are plenty of YouTubers and bloggers that cover these topics quite well.
List the days in a column off to the right. (I used column K.) “Sun”, “Mon”, “Tue”, etc. Select all the cells with the days of the week and name the range “valDays”.
Formula in tblRates[Serial]:
“=MATCH(tblRates[[#This Row],[Day]],valDays,0)+tblRates[[#This Row],[Time]]”
Formula in tblPay[Serial]:
“=WEEKDAY([Date])+[StartTime]”
Formula in tblPay[Rate]:
“=INDEX(tblRates[Rate],MATCH([Serial],tblRates[Serial],0))”
You can download the excel document and view these screenshots of a possible solution.
Link to Excel Workbook on Google Drive
Screenshot1

Calculating Over Time and Late Time payments in excel

I need some help with a formula to automate my over-time and late time salary calculations. I get a report from our system which is in the following format:
"In Time" "Out Time" "Late" "Early" "OT"
All of these have values in the hh:mm:ss format however the cell is formatted as General.
The In Time has the time of the day I punch in.
The Out Time has the time of the day I punch out.
Late has the number of minutes I am late by from my check in time i.e. 10:00 not 10:15.
Early has the number of minutes I am early by.
OT has the number of hours and minutes I a work beyond my shift end time i.e. 6:00
I was hoping to get one column to tell me how much my salary would be deducted if I am late by x minutes. To give you an example, my day starts at 10:00 and I can come as late as 10:15 without any deductions. However for every minute I am late after that, I get a deduction which is calculated by the number of minutes I am late multiplied by my per minute salary ((((10000/30)/8)/60).
And in the second column, I was hoping to calculate how much additional salary I would get for my over time. For example, my shift ends at 6:00 and for every minute after 6:00 I am entitled to over time, which is calculated by the number of minutes I work over time multiples by my per minute over time rate (30/60).
Please let me know if you guys could help me with this. This could be used by almost anyone who wants to make sure their salary is calculated correctly.
"What I really need help with, is the formula for the Late Deduction and Overtime Calculations"
As I implied in my comments, the format of your data is all important. Excel stores times as fractions of a day. So 1 minute = 1/60/24
If you convert ÿour data to a normal Excel time, then the formulas for your Late Deductions and Overtime compensation would be as below. Where Late is the number of minutes you are late (stored as an Excel Time); and OT is the number of overtime minutes.
If these values are stored as plain numbers, omit the 24*60 feature. If these values are stored as Text, you need to change them to either regular numbers or fractions of a day. Exactly how to change them depends on what is making them appear as text.
Late Deduction
=MAX(0,24*60*Late-15)*PerMinuteSalary
Overtime
=24*60*OT*PerMinuteOvertimeSalary

Resources