Leave Calculation Formula in Excel (5 Leave Types)

Say you have a dataset containing working hours and leave types of an employee. You want to calculate half-day, casual, and sick leave for each month.
Overview of leave calculation formula in Excel


Calculate Half Day Leave in Excel

To calculate half-day leave:

  • Insert the following formula to calculate working hours:
    =IFERROR(D6-C6,"-")
  • Use the Fill Handle tool to copy the formula to adjacent cells.Calculating working hour
  • Select the range where you want to apply formatting and press the Ctrl + 1 keys to open the Format Cells dialog box.
  • Select the Number tab > Custom > hh:mm > OK.
    Selecting custom time formatThe time is now in hh:mm format.
    Applying custom time format
  • To obtain the half-day leave, input the following formula and use the Fill Handle tool to copy the formula to adjacent cells.
    =IFERROR(IF((HOUR(E6) +( MINUTE(E6)/ 60))<6,"Half Day Leave","-"),"-")
    If the working hour total is less than 6 hours, the formula returns “Half Day Leave”.
    Finding half day leaves
  • To calculate the total number of half-day leaves insert the following formula:
    =COUNTIF(F6:F34,"Half Day Leave")

    Calculation of half day leave with Excel COUNTIF function.

Calculate Monthly Leave in Excel

To calculate monthly leave:

  • Input the following formula for calculating leave separately:
    =COUNTIF($F$6:$F$34,H5)
  • Drag down the Fill Handle tool to copy the formula to adjacent cells.Leave calculation formula in Excel using COUNTIF function
  • The following formula will calculate the total number of leaves in a month.
    =(I5/2)+I6+I7

    Calculating total monthly leave in Excel

Calculate Annual Leave in Excel

To calculate annual leave:

  • Use the following formula to calculate the various types of leave per month for the year.
    =COUNT(FILTER($B$6:$B$370, ($F$6:$F$370=I$5)*(MONTH($B$6:$B$370)=ROWS($H$6:$H6))))
  • Then use the Fill Handle tool both horizontally and vertically to calculate sick and casual leave for each month.
    Calculating leave for each months
  • Use the following formula to calculate the total half-day leave.
    =SUM(I6:I17)
  • Use the Fill Handle tool horizontally to get the total sick and casual leave, as well.
    Calculating total leave
  • To calculate total leave for the year, use the following formula.
    =SUM(L6:L17)
    Calculation of annual leave with Excel formula

Calculate Accrued Vacation Leave in Excel

Suppose your company allows 1 day of accrued vacation leave per 21 work days.

To calculate accrued vacation leave:

  • Insert the following formula to calculate the total number of office days.
    =(SUMPRODUCT(--ISNUMBER(E6:E370)))
    Calculating total office days
  • Calculate the accrued vacation leave with the following formula.
    =ROUNDDOWN((SUMPRODUCT(--ISNUMBER(E6:E370)))/21,0)
    Calculating accrued vacation leave in Excel

Calculate Leave Balance in Excel

To calculate the leave balance:

  • After entering the Allowed Leave, input the following formula to calculate the available leave balance per leave type.
    =I6-I7
  • Drag the Fill Handle tool horizontally to copy the formula to adjacent cells.
    Calculating leave balance

Download Excel Workbook

Download the free Excel workbook and practice yourself.


<< Go Back to Formula List | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
MD Tanvir Rahman
MD Tanvir Rahman

MD Tanvir Rahman, BUET graduate in Naval Architecture and Marine Engineering, dedicated over a year to the ExcelDemy project. He is an Excel and VBA Content Developer. Having authored 50+ insightful articles, he actively updates and improves over 80 articles, reflecting his commitment to accuracy and currency, managing day-to-day operations, and analyzing and developing Excel and VBA tutorials. His broad interests encompass Data Analysis, Advanced Excel, VBA Macro, Excel Templates, Excel Automation, and Excel Power Query, showcasing a... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo