Sep 26, 2022 12:06 PM
I need to calculate automatically the number of chaperones I need for a field trip.
If I have 1 to 30 students, I need 3, 30 to 60, 6, etc… The calculation is: {#of stduents}/30*3. The number is an integer. But if I have 31 students, it gives me 3 as a result while it should be 4. How can I round up the number to the next integer and not the closest one?
Sep 26, 2022 03:30 PM
Hi @Pascal_Vallet,
Might be easier to nest a few IF statements
IF({#ofStudents}<=30, 3, IF({#ofStudents}<=60, 6))
Sep 26, 2022 07:53 PM
This works in my tests:
ROUNDUP({Number of students} / 30, 0) * 3
Sep 27, 2022 01:51 PM
Thanks for your help. My explanation was not clear, of we need 3 chaperones for 30 students, which means we need 4 for 31, 4 for 40, 5 for 41, 6 for 50, 59, and 60.
The formula that works for me is this one: ROUND(({# Students}/10+.49)
Sep 27, 2022 06:41 PM
I don’t think that formula will work for small numbers of students. For example, for 20 students, I expect that formula to produce only two chaperones.
Here’s another variation to throw into the mix.
IF(
{# Students} <= 30,
3,
CEILING({# Students}/10)
)
Oct 02, 2022 04:40 PM
Thanks for your help, it works !