I am trying to make something like a CountIF statement in SharePoint for the purpose of counting specific choices made in a drop down category for a calendar event.

Currently, when I make a new event, in this case, a Vacation list of employees, I select a dropdown that has a list of positions. ex: "Machinist", Carpenter", Clerk".

I am trying to code something that counts the number of times each category is selected and make sure to limit them to a max number per day.

For example, if I add 5 people within the same day and I try to add 6th I want it to deny it and say "limit reached" or something to that effect.

I assume that I may be able to make a category in the calendar to count choices in a drop down category ex: IF([Category],"Machinist">5,"Limit Reached","Accepted"] and somehow maybe add an AND statement comparing "Start Date" and "End date" to make sure that no more than 5 Machinists can be selected for events in the same day.


SP is not Excel, Formulas can not do any calculations across Rows

So there is not COUNTIF

Typically this is solved by a Workflow looping through the Items

But it can also be solved by Client Side OR Server Side Code

Search for limit entries here on SO,
I have answered the use case several times with some out-of-the-box SP thinking

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.