MalumMorale
New Member
- Joined
- May 28, 2019
- Messages
- 6
Hey everyone,
I'm struggling with trying to correct a formula which is currently delivering a wrong result or at least not the result I am supposed to achieve.
The problem is that the current formula divides by the number of all rows / bookings with the same "contract number" on sheet1.
Thereby the output is wrong for projects with more than one booking since it doesn't deliver the avg amount of working hours / month but the avg per booking.
I've already come up with several different new formulas but neither of them was working the way they were intended to. I'm not sure if what I'm trying to achieve is possible with the current individual excel formulas I'm using or tried using and if so in which order I need to apply them. I'd think calculating the average should not be so difficult, just setting the right data criteria while doing so.
Current/wrong formula for column avg working hours / month:
To better understand what the data looks like I'll give an example with dummy datasets and only add data for one dummy project since it's most likely the best way to visualize the data for clarification.
sheet1/total accounted working hours:
[TABLE="width: 500"]
<tbody>[TR]
[TD]bill number[/TD]
[TD]bill date[/TD]
[TD]contract number[/TD]
[TD]project name[/TD]
[TD]accounting period[/TD]
[TD]person[/TD]
[TD]working hours[/TD]
[/TR]
[TR]
[TD]2019-005
[/TD]
[TD]01.02.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.01.2019[/TD]
[TD]A. B.[/TD]
[TD]114,0[/TD]
[/TR]
[TR]
[TD]2019-005[/TD]
[TD]01.02.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.01.2019[/TD]
[TD]C. D.[/TD]
[TD]80,4[/TD]
[/TR]
[TR]
[TD]2019-005[/TD]
[TD]01.02.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.01.2019[/TD]
[TD]E. F.[/TD]
[TD]70,4[/TD]
[/TR]
[TR]
[TD]2019-005[/TD]
[TD]01.02.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.01.2019[/TD]
[TD]G. H.[/TD]
[TD]90,6[/TD]
[/TR]
[TR]
[TD]2019-070[/TD]
[TD]01.03.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.02.2019[/TD]
[TD]A. B.[/TD]
[TD]120,3[/TD]
[/TR]
[TR]
[TD]2019-070[/TD]
[TD]01.03.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.02.2019[/TD]
[TD]C. D.[/TD]
[TD]179,3[/TD]
[/TR]
[TR]
[TD]2019-070[/TD]
[TD]01.03.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.02.2019[/TD]
[TD]E. F.[/TD]
[TD]150,2[/TD]
[/TR]
[TR]
[TD]2019-070[/TD]
[TD]01.03.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.02.2019[/TD]
[TD]G. H.[/TD]
[TD]110,5[/TD]
[/TR]
[TR]
[TD]2019-089[/TD]
[TD]01.04.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.03.2019[/TD]
[TD]A. B.[/TD]
[TD]80,3[/TD]
[/TR]
[TR]
[TD]2019-089[/TD]
[TD]01.04.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.03.2019[/TD]
[TD]C. D.[/TD]
[TD]60,3[/TD]
[/TR]
[TR]
[TD]2019-091[/TD]
[TD]01.05.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.04.2019[/TD]
[TD]A. B.[/TD]
[TD]140,9[/TD]
[/TR]
[TR]
[TD]2019-091[/TD]
[TD]01.05.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.04.2019[/TD]
[TD]C. D.[/TD]
[TD]100,3[/TD]
[/TR]
[TR]
[TD]2019-091[/TD]
[TD]01.05.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.04.2019[/TD]
[TD]E. F.[/TD]
[TD]99,9[/TD]
[/TR]
[TR]
[TD]2019-091[/TD]
[TD]01.05.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.04.2019[/TD]
[TD]G. H.[/TD]
[TD]97,5[/TD]
[/TR]
[TR]
[TD]2019-091[/TD]
[TD]01.05.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.04.2019[/TD]
[TD]I. J.[/TD]
[TD]40,3[/TD]
[/TR]
[TR]
[TD]2019-091[/TD]
[TD]01.05.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.04.2019[/TD]
[TD]K. L.[/TD]
[TD]60,6[/TD]
[/TR]
</tbody>[/TABLE]
sheet2/controlling:
[TABLE="width: 500"]
<tbody>[TR]
[TD]contract number[/TD]
[TD]project name[/TD]
[TD]avg working hours / month[/TD]
[TD]state[/TD]
[/TR]
[TR]
[TD]1000-1[/TD]
[TD]mr. excel[/TD]
[TD]0,00 ???[/TD]
[TD]ok[/TD]
[/TR]
</tbody>[/TABLE]
Please let me know if you need more information or have a fix for my problem!
I'll be looking forward for your responses! Thanks for taking your time to help me out!
- Stephan
I'm struggling with trying to correct a formula which is currently delivering a wrong result or at least not the result I am supposed to achieve.
The problem is that the current formula divides by the number of all rows / bookings with the same "contract number" on sheet1.
Thereby the output is wrong for projects with more than one booking since it doesn't deliver the avg amount of working hours / month but the avg per booking.
I've already come up with several different new formulas but neither of them was working the way they were intended to. I'm not sure if what I'm trying to achieve is possible with the current individual excel formulas I'm using or tried using and if so in which order I need to apply them. I'd think calculating the average should not be so difficult, just setting the right data criteria while doing so.
Current/wrong formula for column avg working hours / month:
- =IFERROR(AVERAGEIFS(sheet1[working hours];sheet1[contract number];[@[contract number]]);
To better understand what the data looks like I'll give an example with dummy datasets and only add data for one dummy project since it's most likely the best way to visualize the data for clarification.
sheet1/total accounted working hours:
[TABLE="width: 500"]
<tbody>[TR]
[TD]bill number[/TD]
[TD]bill date[/TD]
[TD]contract number[/TD]
[TD]project name[/TD]
[TD]accounting period[/TD]
[TD]person[/TD]
[TD]working hours[/TD]
[/TR]
[TR]
[TD]2019-005
[/TD]
[TD]01.02.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.01.2019[/TD]
[TD]A. B.[/TD]
[TD]114,0[/TD]
[/TR]
[TR]
[TD]2019-005[/TD]
[TD]01.02.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.01.2019[/TD]
[TD]C. D.[/TD]
[TD]80,4[/TD]
[/TR]
[TR]
[TD]2019-005[/TD]
[TD]01.02.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.01.2019[/TD]
[TD]E. F.[/TD]
[TD]70,4[/TD]
[/TR]
[TR]
[TD]2019-005[/TD]
[TD]01.02.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.01.2019[/TD]
[TD]G. H.[/TD]
[TD]90,6[/TD]
[/TR]
[TR]
[TD]2019-070[/TD]
[TD]01.03.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.02.2019[/TD]
[TD]A. B.[/TD]
[TD]120,3[/TD]
[/TR]
[TR]
[TD]2019-070[/TD]
[TD]01.03.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.02.2019[/TD]
[TD]C. D.[/TD]
[TD]179,3[/TD]
[/TR]
[TR]
[TD]2019-070[/TD]
[TD]01.03.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.02.2019[/TD]
[TD]E. F.[/TD]
[TD]150,2[/TD]
[/TR]
[TR]
[TD]2019-070[/TD]
[TD]01.03.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.02.2019[/TD]
[TD]G. H.[/TD]
[TD]110,5[/TD]
[/TR]
[TR]
[TD]2019-089[/TD]
[TD]01.04.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.03.2019[/TD]
[TD]A. B.[/TD]
[TD]80,3[/TD]
[/TR]
[TR]
[TD]2019-089[/TD]
[TD]01.04.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.03.2019[/TD]
[TD]C. D.[/TD]
[TD]60,3[/TD]
[/TR]
[TR]
[TD]2019-091[/TD]
[TD]01.05.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.04.2019[/TD]
[TD]A. B.[/TD]
[TD]140,9[/TD]
[/TR]
[TR]
[TD]2019-091[/TD]
[TD]01.05.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.04.2019[/TD]
[TD]C. D.[/TD]
[TD]100,3[/TD]
[/TR]
[TR]
[TD]2019-091[/TD]
[TD]01.05.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.04.2019[/TD]
[TD]E. F.[/TD]
[TD]99,9[/TD]
[/TR]
[TR]
[TD]2019-091[/TD]
[TD]01.05.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.04.2019[/TD]
[TD]G. H.[/TD]
[TD]97,5[/TD]
[/TR]
[TR]
[TD]2019-091[/TD]
[TD]01.05.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.04.2019[/TD]
[TD]I. J.[/TD]
[TD]40,3[/TD]
[/TR]
[TR]
[TD]2019-091[/TD]
[TD]01.05.2019[/TD]
[TD]1000-1 [/TD]
[TD]mr. excel[/TD]
[TD]01.04.2019[/TD]
[TD]K. L.[/TD]
[TD]60,6[/TD]
[/TR]
</tbody>[/TABLE]
sheet2/controlling:
[TABLE="width: 500"]
<tbody>[TR]
[TD]contract number[/TD]
[TD]project name[/TD]
[TD]avg working hours / month[/TD]
[TD]state[/TD]
[/TR]
[TR]
[TD]1000-1[/TD]
[TD]mr. excel[/TD]
[TD]0,00 ???[/TD]
[TD]ok[/TD]
[/TR]
</tbody>[/TABLE]
Please let me know if you need more information or have a fix for my problem!
I'll be looking forward for your responses! Thanks for taking your time to help me out!
- Stephan