Hi guys,
This should be simple but its making my brain hurt...
I have four columns: Girls > 10, Boys >10, Girls <10, Boys <10
I am trying to calculate how many rooms are required.
The logic rules are as follows.
max 2 people to a room
Girls > 10 can share
Boys > 10 can share
A girl > 10 and a girl <10 can share
A boy >10 and a girl <10 can share
A boy >10 and a girl <10 can share
Example Results
I am trying to build a forumla using FLOORs and MODs to calculate the correct number of rooms, but can't find a solution that covers all eventualities
can anyone help?
This should be simple but its making my brain hurt...
I have four columns: Girls > 10, Boys >10, Girls <10, Boys <10
I am trying to calculate how many rooms are required.
The logic rules are as follows.
max 2 people to a room
Girls > 10 can share
Boys > 10 can share
A girl > 10 and a girl <10 can share
A boy >10 and a girl <10 can share
A boy >10 and a girl <10 can share
Example Results
Code:
[FONT=Courier New]G+ B+ G- B- Result Reason[/FONT]
[FONT=Courier New]1 1 1 1 2 2 girls can share, 2 boys can share[/FONT]
[FONT=Courier New]1 0 0 1 2 Cannot share, different sex and one over 10[/FONT]
[FONT=Courier New]1 1 0 0 2 Cannot share, different sex and one over 10[/FONT]
[FONT=Courier New]0 0 1 1 1 Can share, both under 10[/FONT]
[FONT=Courier New]1 0 1 1 2 G- can share with either G+ for B-[/FONT]
[FONT=Courier New]1 0 2 1 2 one G- can share with G+, the other can share with B-[/FONT]
I am trying to build a forumla using FLOORs and MODs to calculate the correct number of rooms, but can't find a solution that covers all eventualities
can anyone help?