Tallying multiple columns & rows of radio buttons

New Here ,
Aug 10, 2022 Aug 10, 2022

Copy link to clipboard

Copied

I have created a sheet that allows you to make one selection per rows and now I need the columns to tally, but cannot figure it out.  I have inserted a portion of my sheet below.  I need the yes column to total the number of buttons checked as well as the no column.  The second section I was able to create the sheet where only 1 choice can be checked per row, but now need the column to total the number of checked radio buttons.  Any suggestions?

marieb82518474_0-1660150665325.png

 

Views

56

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 10, 2022 Aug 10, 2022

Copy link to clipboard

Copied

I've moved this from the Using the Community forum (which is the forum for issues using the forums) to the Acrobat forum so that proper help can be offered.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 10, 2022 Aug 10, 2022

Copy link to clipboard

Copied

You can give radio buttons different choices for example you have columns 5,4,3,2,1 so under number 5 column give every radio button choice 5, under number 4 column give them choice 4...etc. then in one of the text field as custom calculation script use this:

var t1=0,t2=0,t3=0,t4=0,t5=0;
for(var i=1; i<=20; i++){
if(this.getField("Question "+i).valueAsString == "1")t1++;
if(this.getField("Question "+i).valueAsString == "2")t2++;
if(this.getField("Question "+i).valueAsString == "3")t3++;
if(this.getField("Question "+i).valueAsString == "4")t4++;
if(this.getField("Question "+i).valueAsString == "5")t5++;}
this.getField("Text1").value = t5;
this.getField("Text2").value = t4;
this.getField("Text3").value = t3;
this.getField("Text4").value = t2;
this.getField("Text5").value = t1;

If you changed choices correctly, it will total how many radio buttons are checked for each column.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 10, 2022 Aug 10, 2022

Copy link to clipboard

Copied

Thank you, but I'm still doing something wrong.  I believe I updated my buttons to reflect Choice 1 thru 5, but cannot get the custom calculation to work.  I am relatively new to Adobe Acrobat.

marieb82518474_0-1660156828543.png

Should I be starting from scratch inserting the radio buttons?

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 10, 2022 Aug 10, 2022

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 10, 2022 Aug 10, 2022

Copy link to clipboard

Copied

Thank you! 

What is the custom calculation for the top yes/no section?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 10, 2022 Aug 10, 2022

Copy link to clipboard

Copied

Give column 'Yes' choices "Yes" and column 'No' choices "No", then as custom calculation script of "Text7" or "Text8" field use this:

var y=0,n=0;
var fields = ["500K","500K-1M","1M-2M","2M-3M","3M+"];
for(var j in fields){
if(this.getField(fields[j]).valueAsString == "Yes")y++;
if(this.getField(fields[j]).valueAsString == "No")n++;}
this.getField("Text7").value = y;
this.getField("Text8").value = n;

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 10, 2022 Aug 10, 2022

Copy link to clipboard

Copied

LATEST

Again Thank You!!!!!!!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

Make content for your business needs with Adobe Express.

Get started easily with free templates: