Help

Count with conditional

Topic Labels: Formulas
Solved
Jump to Solution
1958 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Martin_Hennessy
4 - Data Explorer
4 - Data Explorer

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)

1 Solution

Accepted Solutions
Kamille_Parks
16 - Uranus
16 - Uranus

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.

See Solution in Thread

2 Replies 2
Kamille_Parks
16 - Uranus
16 - Uranus

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.

Martin_Hennessy
4 - Data Explorer
4 - Data Explorer

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