Forum Discussion
Excel Annual Leave calculation
Hi there,
Looking for help creating a complex (if even possible) formula!
Cleaning up a spreadsheet for work and I'm trying to create a formula that will do a few things:
- something to the extent of =COUNTIF(F8:F127, ">2") where it is summing all days where my staffing levels were above the minimum
- remove any of the A/L outputted by a seperate formula in another section: =SUM('Department'!K4:L8) if the condition that their "Role" in Column H is on a specified list AND/OR if they have no entitlement allocated in the table (Column G).
I know that to subtract the values where those conditions are met would require a formula targetting the table directly (ie: =SUM(COUNTA'Department'!K4:L8)-COUNTIF(OR(OFFSET(K4,0,-1)=""),COUNTIF(K4=DataAdmin!$L2:$L6))
I feel like I am asking a lot for one formula and I know the basics enough that I am pretty sure this won't be possible, but it doesn't hurt to ask!
I appreciate any suggestions on how I can get this to work!
NB: The reason I don't just omit the cell ranges for the staff members I don't want to include is because I am not the sole manager of this spreadsheet and the staff members get updated or changed without correcting the criteria ranges, so I'm hoping to try and create this "cover all" formula!
Some names have been or will be omitted or changed to protect identity or preserve confidentiality.
Happy to provide more details or context if needed!
If you think I'm being crazy, feel free to tell me to go and resit Excel Coding and Formulas 101 again ![]()
- Oli
6 Replies
- mathetesGold Contributor
Had you intended to attach a copy (or a mockup with names changed) of the spreadsheet? If so, it's not here. If not, please do anyway. Use OneDrive or GoogleDrive and post a link here that grants access.
Then, if I might be so bold, don't try to write the formula for us. Instead, describe in words what you want done. You can refer to the column heads (if there's also an attached spreadsheet), but don't try to write the formula for us--that's what you're coming to ask for help on. Describing it in words is the best way to start off.
- OliverBoardmanCopper Contributor
Good Morning,
Apologies for the hubris! I shall use Google Drive, but you shall have to bear with me as I need to recreate the spreadsheet with no names 🙂EDIT: link removed as newer one available
- mathetesGold Contributor
I hope you're planning on returning to flesh this out some more. You'll also need to give some assistance in navigating this maze, connecting it to your original questions.