» «

2 replies to this topic
Indi
• Indi

Don't cross the streams.

• Andolini Mafia Family
• Joined: 22 Nov 2008

#1 Posted 05 April 2012 - 10:00 PM

Hi,

I'm doing a spreadsheet for my school and I was wondering how I could give an automatic calculation of the no. of people needed to be seated into each room. So say if there were 6 adults and 1 child going onto the trip; and I had the options of a Double Room, Single Room, and a Triple Room for them to choose from.

How would I put, in a formula... to automatically insert the total number of people into the correct rooms?

I was also wondering if someone could go through "IF" functions for changing a formula already inserted into the spreadsheet into another one.

fred
• fred

• Joined: 20 Jul 2002

#2 Posted 06 April 2012 - 09:19 AM

If there's no other constraints and assuming the goal is to minimise the number of rooms, surely it's just a case of getting as many triples as possible plus one single or double depending on how many people are left over?
Triples = FLOOR(people/3)
Remainder = MOD(people, 3)
Doubles = IF(Remainder=2, 1, 0)
Singles = IF(Remainder=1, 1, 0)

Indi
• Indi

Don't cross the streams.

• Andolini Mafia Family
• Joined: 22 Nov 2008

#3 Posted 06 April 2012 - 01:33 PM Edited by Indi, 06 April 2012 - 02:04 PM.

Sounds right, what your saying, but I need to know what those functions do now.
http://puu.sh/occK

...and where do I put them.

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users