Occupation rate

Hello, I need to calculate the occupancy rate of my accommodations.

I need to know, over a given period, how many days the apartment is occupied.

For example, if I select from October 14th to October 31st, and my apartment is booked from October 10th to October 20th, I need to get a result of 6 days.

I would like to sum this number of days for several apartments.

My booking dates are saved as date ranges.

I can’t find the Bubble “mathematical formula” to get this result. I don’t have access to intersect with, or at least not on a date range because it’s on a list of Bookings.

Any ideas?