Skip to main content

Formula to calculate number of chaperones

  • September 26, 2022
  • 5 replies
  • 46 views

Pascal_Vallet
Forum|alt.badge.img+14

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?

5 replies

Forum|alt.badge.img+16
  • Inspiring
  • September 26, 2022

Hi @Pascal_Vallet,
Might be easier to nest a few IF statements

IF({#ofStudents}<=30, 3, IF({#ofStudents}<=60, 6))

Justin_Barrett
Forum|alt.badge.img+21

This works in my tests:

ROUNDUP({Number of students} / 30, 0) * 3


Pascal_Vallet
Forum|alt.badge.img+14
  • Author
  • Inspiring
  • September 27, 2022

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)


kuovonne
Forum|alt.badge.img+29
  • Brainy
  • September 28, 2022

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)
)

Pascal_Vallet
Forum|alt.badge.img+14
  • Author
  • Inspiring
  • October 2, 2022

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)
)

Thanks for your help, it works !