Forum Discussion
Formula to calculate # of single vs double rooms
Hi Sergei, so the % would be input, and also total number of beds (94) is an input too. I want the ability to adjust either of the two get the number of rooms needed.
So I finally figured it out:
if S = Single Occupancy %
and D = Double Occupancy %
E6 =INT((E2/(B5+B6+B6))*B6)
E5 =E2-(E6*2)
had to divide the 94 by adding S+two times D to get the equal part of 94 beds and then multiply it by D to get the actual double occupancy room count. I hope that makes sense
When you did the job, thank you for the clarification. I'd suggest to use two inputs - number of beds and % of Double, assuming S+D is always 100%. When the logic is
S+2D=Beds
D= D%*(D+S)
From here
D=Beds*D%/(1+D%)
or in E6
=INT(E2*B6/(1+B6) )
It's always the rounding and yes, it's more reasonable to trunk number of double rooms.