Formula to calculate number of member on specific days


I have three table :
Table one 【member data】
which have
{start date}
{end date}
{single linked to weekly summary}

table two【activities】
{date of activities}
{multiple linked to weekly summary per person}

table three 【weekly summary per person】
{week number}
{single linked to member data}
{multiple linked to activities}

If I want each activity to have the accurate number of member during {date of activity} , to get the real attendance rate.
How could I do to set up the formula…??