我试图找出一名员工在我公司工作的平均时间。现在我已经单独计算了每个终止人员的时间,并将其显示为年、月和天。我想把所有的时间相加,然后除以被解雇的员工人数,然后再次显示为年、月、日,以显示我们雇用员工的平均时间。
这是我用于“公司时间”列的公式:
=DATEDIF(E2,F2,"y") & " years, " & DATEDIF(E2,F2,"ym") & " months, " & DATEDIF(E2,F2,"md") & " days "
Date of Hire Date of Termination Time with Company
5/11/2011 6/13/11 0 years, 1 months, 2 days
6/6/2011 8/28/11 0 years, 2 months, 22 days
8/15/2011 2/20/12 0 years, 6 months, 5 days
6/13/2011 5/13/12 0 years, 11 months, 0 days
Run Code Online (Sandbox Code Playgroud)