Help with a sum

This is an exercise.

I have a reservation page. The user logs in and has 2 inputs:

  • Attendance (Yes/No)
  • N° guests

Both belong to a reservation table.

What I want to dynamic calculate is this:
X = IF the guest is attending (Attendance = Yes) sum N° guests + 1.

And then I want to reflect this as a total:
Total attending guests are X1, X2, X3 (each user X)

How can I do it? I can’t solve it.


This can be done by creating an input to hold the sum. You can set the initial content of the input to the search of the data. You can either have this input be visible or hidden but you can still refer to it either way.

I created a small form to demonstrate:

And the content of the input to sum each items guest where attending equals yes:

If you had any further questions or require any more assistance please let me know.

Michael Cafra