Answer the question
In order to leave comments, you need to log in
What is the formula for these travel allowance calculations?
Good afternoon. The task is to write a travel allowance calculator. This calculator form was taken as a sample (specifically, the Päivärahat section). The bottom line is this: when an employee is on a business trip, depending on the time spent on it, the employee is charged a certain amount according to logic that is not entirely clear to me.
Full daily rate - 43 euros. Partial rate - 20 euros. If the business trip lasted less than 6 hours, then nothing is charged. If more than 6 - then a partial bet. If more than 10 - then the full daily rate. But when I started testing longer time intervals, the following became clear:
01/01/2020, 22:00 - 0 (until 6 hours) (I left on January 1 at 22 hours, no charges are due yet)
01/02/2020, 04:01 - 20 euros (> 6 hours) + 6 hours __partial rate__ 01/02/2020
, 8:01 - 43 euros (> 10 hours) + 4 hours _____full rate_____
01/03/2020, 0:01 - 63 euros (> 26 hours) + 16 hours __+ more partial rate__
03.01.2020, 4:01 - 86 euros (> 30 hours) + 4 hours _____+ one more full rate_____
04.01.2020, 0:01 - 106 euros (> 50 hours) + 20 hours __+ more partial rate__
04.01.2020, 4:01 - 129 euros (> 54 hours) + 4 hours _____+ one more full rate _____
05.01.2020, 0:01 - 149 euros (> 74 hours) + 20 hours __+ more partial rate__
05.01.2020, 4:01 - 172 euros (> 78 hours) + 4 hours _____+ one more full rate _____
06.01.2020, 0:01 - 192 euros (> 98 hours) + 20 hours __ + more partial rate__
etc...
Those. first there are intervals +6, +4, +16 hours. And then - only alternate +4 and +20. So, for example, before 4 am on 04.01, 106 euros are supposed to be paid (these are 2 full daily rates + one partial: 43 * 2 + 20). And from 04:01 the next interval begins, and 129 euros (three full daily rates) are subject to payment.
The problem is that I cannot see any universal pattern in these calculations. It is also confusing that not just values, but intervals of values are subject to calculation. I would be grateful for the hint of the formula by which these calculations are carried out.
Answer the question
In order to leave comments, you need to log in
In excel, I sketched empirically:
=MAX(0,INT((A1+18)/24)*43+IF(MOD((A1-6),24)>19,20,0)-IF(A1<10,23,0))
The original "formula" is most likely present somewhere on the legislative website of the country (if it is regulated by state law) or in something similar in organization.
Trying to identify patterns from the output of a certain site without understanding at least the general principles is pointless, and if you understand the principles, the site is not needed (unless you check your implementation).
In my opinion, at least when calculating travel allowances, the following can be taken into account "in a special way":
- the day of departure and the day of return
- officially working days and holidays (such as extra processing and with different rates depending on the amount of processing)
- the total time spent on a business trip relative to a certain minimum / maximum number of working hours per week/month
- type of rate (full/part-time) of the employee
- schedule (sheet) of the employee - for an employee 5/7 the numbers may differ from 2/3, etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question