✔ 最佳答案
假設A1是總年資(未扣放假數目),下面是A1總年資所得的年假日數 :
=IF(A1>8,77+(A1-8)*14,IF(A1>7,64+(A1-7)*13,IF(A1>6,52+(A1-6)*12,IF(A1>5,41+(A1-5)*11,IF(A1>4,31+(A1-4)*10,IF(A1>3,22+(A1-3)*9,IF(A1>2,14+(A1-2)*8,IF(A1>1,7+(A1-1)*14,A1*7))))))))
例如: 年資3年4個月即3.333年,輸入3.333於A1得25天年假(未扣之前所放的年假)。
這是否你想要的。
2013-08-08 14:43:25 補充:
(離職日期 - 入職日期 + 1)/365
2013-08-09 13:21:23 補充:
最尾個14應該係7,更正如下:
=IF(A1>8,77+(A1-8)*14,IF(A1>7,64+(A1-7)*13,IF(A1>6,52+(A1-6)*12,IF(A1>5,41+(A1-5)*11,IF(A1>4,31+(A1-4)*10,IF(A1>3,22+(A1-3)*9,IF(A1>2,14+(A1-2)*8,IF(A1>1,7+(A1-1)*7,A1*7))))))))
ABCDEFGHI1姓名到職日期年資 (年)年資 (月)每年可賺年假率不足一年按比例年假年假
總額已放取的年假總數經扣減的年假2張三01/01/20121774.08333333311.08110.083李四01/05/20094392.2538.25236.254黃五15/08/201111176.41666666713.42310.425陳六13/01/19979614713341296 7截數日期 808/08/2013
在 A8 S輸入截數日期, 然後再依次輸入以下公式, 請測試。
C2=IF(DATEDIF(B2,$A$8,"y")>9,9,DATEDIF(B2,$A$8,"y"))D2= DATEDIF(B2,$A$8,"ym")E2=CHOOSE(IF(DATEDIF(B2,$A$8,"y")>9,9,DATEDIF(B2,$A$8,"y")),7,7,8,9,10,11,12,13,14)F2=CHOOSE(IF(DATEDIF(B2,$A$8,"y")>9,9,DATEDIF(B2,$A$8,"y")),7,7,8,9,10,11,12,13,14)/12*DATEDIF(B2,$A$8,"ym")
G2=ROUND(IF(DATEDIF(B2,$A$8,"y")>9,9,DATEDIF(B2,$A$8,"y"))*CHOOSE(IF(DATEDIF(B2,$A$8,"y")>9,9,DATEDIF(B2,$A$8,"y")),7,7,8,9,10,11,12,13,14)+CHOOSE(IF(DATEDIF(B2,$A$8,"y")>9,9,DATEDIF(B2,$A$8,"y")),7,7,8,9,10,11,12,13,14)/12*DATEDIF(B2,$A$8,"ym"),2)