Count with conditional

I am using airtable to make a rota

I have a table of doctors and a separate table for each month of the year

A field in the month table links to the doctors table so i can put a doctor’s name in that day

i would like to count how many on calls each doctor does

more specifically, i would like to count weekdays, weekends and public holidays separately

to that end, i created another table that links to the dates on the month table and classes each day as a weekend, weekday or public holiday

i know the information is there - if i select a doctor from the doctors table, the linked field to the month table contains a list of dates that doctor is on call

but how can i count those dates and even count them based on whether they’re a weekend or not etc? i’ve been trying for a few hours now, messing about with rollups, new tables and copious google/forum searching, but have got nowhere

sorry if this is badly worded

(for some reason i can’t attach the screenshots i’ve taken - the webform wont let me)

Create a formula field ({Weekday Count'}): IF({Day Type}='Weekday',1,0)
Use a rollup field to count these values.

Repeat for weekends and holidays.

Thanks! Can’t believe I hadn’t thought of it!