1 Reply Latest reply on May 27, 2011 8:52 AM by jamcwh07

# how to sum 'columns' of radio buttons

Ok, this may sound odd, and I have very limited knowledge of formcalc, but here goes.

I have 6 rows of radio buttons, each its own group.  Each row has 5 buttons.  The value for each row will be set from 1 to 5 depending on which button the user selects.

Below all of the buttons I need 5 numeric fields that will add up how many of each 'column' the user has entered.  Something like two 1's one 2 three 3's zero 4's zero 5's.

I can't figure out how to make this happen.

for the first numeric field (counting first column/1's) i can get it to count the first row by doing something like:

var ones = 0

if (row1<>1)

then ones

else ones+1

That's all I can get to work...

I am probably not even  barking up the right tree here... any help would be appreciated.

Chris

ps, I know i could just group the buttons vertically, but then you would be able to select multiple options along the 'row' and that can't be allowed.

• ###### 1. Re: how to sum 'columns' of radio buttons

so are you trying to add up total number of points in a column basically?

if you want to do total #1's, #2's etc.

you could make it so each radio button is an independant field, reassign the values on each one to the desired amount and then use formcalc in order to sum up the buttons in each column.

To use the form calc, you would just need to use this form:

sum(button1, button2,button3....etc) then you can add functions such as /5 to divide by five for example.

when you create the sum() the easiest way to add fields to the list is to hold down ctrl and then bring the mouse to the desired field and a larve V will appear.  Click to add field.  This will add the address of the field on the form as well as the name.

Pretty easy to do, reply back if you have any issues i might be able to help you out