We’ll use a dataset of 5 employees of a company to create a leave tracker.
="January"&Summary!C6
=B4
=DATE(Summary!$C$6,1,1)
=IF(MONTH($AD8+1)>MONTH($C$8),"",$AD8+1)
Breakdown of the Formula
MONTH($AD8+1): This function returns 1.
MONTH($C$8): This function returns 1.
IF(MONTH($AD8+1)>MONTH($C$8),””,$AD8+1): This function returns the date.
Breakdown of the Formula
WEEKDAY(C8,1): This function returns 7.
INDEX(,WEEKDAY(C8,1)): This function returns Sa.
IF(C8=””,””,INDEX(,WEEKDAY(C8,1))): This function returns the day name Sa.
=COUNTIF($C9:$AG9,AH$8)+0.5*COUNTIF($C9:$AG9,AH$8&"H")+0.5*COUNTIF($C9:$AG9,"H"&AH$8)
Breakdown of the Formula
COUNTIF($C9:$AG9,AH$8): This function returns 1.
COUNTIF($C9:$AG9,AH$8&”H”): This function returns 0.
COUNTIF($C9:$AG9,”H”&AH$8): This function returns 0.
COUNTIF($C9:$AG9,AH$8)+0.5*COUNTIF($C9:$AG9,AH$8&”H”)+0.5*COUNTIF($C9:$AG9, “H”&AH$8): This function returns the day name 1.
=Summary!C9
=SUM(AH9:AH13)
=IFERROR(INDEX(Jan!AH$9:AH$13,MATCH($B10,Jan!$B$9:$B$13,0)),0)+IFERROR(INDEX(Feb!AH$9:AH$13,MATCH($B10,Feb!$B$9:$B$13,0)),0)+IFERROR(INDEX(Mar!AH$9:AH$13,MATCH($B10,Mar!$B$9:$B$13,0)),0)+IFERROR(INDEX(Apr!AH$9:AH$13,MATCH($B10,Apr!$B$9:$B$13,0)),0)+IFERROR(INDEX(May!AH$9:AH$13,MATCH($B10,May!$B$9:$B$13,0)),0)+IFERROR(INDEX(Jun!AH$9:AH$13,MATCH($B10,Jun!$B$9:$B$13,0)),0)+IFERROR(INDEX(Jul!AH$9:AH$13,MATCH($B10,Jul!$B$9:$B$13,0)),0)+IFERROR(INDEX(Aug!AH$9:AH$13,MATCH($B10,Aug!$B$9:$B$13,0)),0)+IFERROR(INDEX(Sep!AH$9:AH$13,MATCH($B10,Sep!$B$9:$B$13,0)),0)+IFERROR(INDEX(Oct!AH$9:AH$13,MATCH($B10,Oct!$B$9:$B$13,0)),0)+IFERROR(INDEX(Nov!AH$9:AH$13,MATCH($B10,Nov!$B$9:$B$13,0)),0)+IFERROR(INDEX(Dec!AH$9:AH$13,MATCH($B10,Dec!$B$9:$B$13,0)),0)
Breakdown of the Formula
MATCH($B10,Jan!$B$9:$B$13,0): This function returns 2.
INDEX(Jan!AH$9:AH$13,MATCH($B10,Jan!$B$9:$B$13,0)): This function returns 0.
IFERROR(INDEX(Jan!AH$9:AH$13,MATCH($B10,Jan!$B$9:$B$13,0)),0): This function returns 1.
=SUM(C10:H10)
=SUM(C10:C14)
Soumik Dutta, having earned a BSc in Naval Architecture & Engineering from Bangladesh University of Engineering and Technology, plays a key role as an Excel & VBA Content Developer at ExcelDemy. Driven by a profound passion for research and innovation, he actively immerses himself in Excel. In his role, Soumik not only skillfully addresses complex challenges but also demonstrates enthusiasm and expertise in gracefully navigating tough situations, underscoring his unwavering commitment to consistently deliver exceptional, high-quality content that. Read Full Bio
15 CommentsHi! Am Babalola Olona. I want to say a very big thank you to ExcelDemy for this great article as this will go a long way to help build up a lot of learners. While I am happy that am able to learn a lot from this piece I however have challenges comprehending Step 3 “Generate Final Leave Tracker”, I really cant understand the formula used “IFERROR, INDEX, MATCH & SUM”. I can’t also understand the rational behind the use of 0.5, “H” & in the COUNTIF function. i will be eternally grateful this FUNCTIONS can be further broken down for a better understanding. Thank you.
Reply
Naimul Hasan Arif Apr 5, 2023 at 12:02 PMThanks a lot BABALOLA for the appreciation. It means a lot.
In response to your first question, let me break down the whole formula with IFERROR, INDEX, MATCH & SUM and explain it to you. The first part of the formula here is IFERROR(INDEX(Jan!AH$9:AH$13,MATCH($B10,Jan!$B$9:$B$13,0)),0)
First of all the MATCH function looks through the value in range B9:B13 of Jan sheet whether it matches the value in cell B10. If it gets matched, it will return the related value according to the index from the AH9:AH13 range. The IFERROR Function is used to return a value(i.e. 0) if it can not find any proper value to return.
Similarly, I have gone through all 12 months’ sheets and added them with the SUM function. In response to your second question, the & sign is used to concatenate cell AH$8 with the letter H. As it is considered a half match, 0.5 is multiplied. We have considered two half-matches to have the full match count.
Hello, I track leave for my company and need more rows than 5 (much more than 5 people), how do I insert rows without messing up the formula?
Reply
Joyanta Mitra Aug 2, 2023 at 1:11 PMDear Karlyn Martinez,
For your convenience, I have showed the task with following steps.
Steps:
● First, you have to recognize the pattern in the formula
● You can use Format Painter or drag the row to add a new row or rows for editing new data.
● Now add new data.
● Inset new rows in the Summary sheet.
● Insert the Entire row.
● Edit the code according to the main dataset. As now in Jan worksheet, new data is added, and so the range will be changed to AH$15 and $B$15.
Hope, this will be helpful for you. Regards,
Joyanta Mitra
Excel & VBA Content Developer
We ran into issues with the large formula since our line number weren’t exactly like yours. For instance, I have 10 employees vs 7. We’re still working on it but not quite there yet. Wish there was an easier way to get the summary.
How do you record half day leave?Reply
Aniruddah Alam Jan 15, 2024 at 9:39 AMHi KOH, Thanks for reaching out to us! Unfortunately, the method discussed above doesn’t currently support recording half-day leave. We understand how frustrating that can be, and we’re sorry for any inconvenience caused. Rest assured, we’ll definitely work on overcoming this limitation in the future. We’re grateful for your support of Exceldemy and we hope to make your experience even better in the future. Best regards,
Aniruddah
Team Exceldemy
Hello – this tutorial has been so helpful – THANK YOU! I am however struggling to get my summary to pick up leave noted throughout the year when i carry out my test (as you do in your video)……I cannot work out where I have made an error as I thought I was being very careful to follow all of your instructions….can you please provide any help?
Reply
Lutfor Rahman Shimanto Mar 24, 2024 at 4:28 PMHello Tracey Thanks for your nice words. Your appreciation means a lot to us. Creating a Leave Tracker in Excel requires multiple steps, so you may often get unintentional errors when following these steps. Do not worry! You can share your problem within the ExcelDemy Forum by attaching your workbook. Regards
ExcelDemy
Hello
I am not having any luck with step 3 generate final leave tracker on the summary page. I have tried it many different ways with no luck. Can I send it to get some help?
Reply
Lutfor Rahman Shimanto Mar 27, 2024 at 5:09 PMHello Bonnie Thanks for reaching out. Though a few steps are needed, making mistakes along the way is obvious. But no worries! The ExcelDemy Forum is there to help. Just share your workbook and ask for advice. Regards
Lutfor Rahman Shimanto
ExcelDemy
Reply
Lutfor Rahman Shimanto May 19, 2024 at 12:20 PMDear Sanjeev Thanks for visiting our blog and sharing your problem. After adding the desired rows, you must drag the Fill Handle icon to copy the existing formulas for new employees. We have improved the file and made the necessary formula adjustments based on your goal. SOLUTION Overview: You can download the solution file: https://www.exceldemy.com/wp-content/uploads/2024/05/Sanjeev-Fernandes-SOLVED.xlsx Regards
Lutfor Rahman Shimanto
ExcelDemy
Reply
Shamima Sultana Aug 17, 2024 at 11:31 AMHello Babajide, Thanks! We are glad to hear that you found it great. We try our best to provide excellent services. Keep learning Excel with ExcelDemy! Regards
ExcelDemy