Help! automatic count columns

Hi everyone!
Can someone help me, pls?

As my printout below,

I have a test with multiple choice answers.
I would like to automate the results.
For example: I have the columns where the test already records the answers, which can be A, B or C and I would like to have the automatic columns displaying how many answers A, B, and C the user marked.

Can anyone help me?

See if I was clear, if not, I am available to explain better.

Hola!,

I think this solution applies to your case.

Here my step by step:

1- You have something like this, an Answer List table to save your answers

2- and another table where you set up your answers to have a kind of order/definitions
image

3- The trick is to bring all answers (one by one) to this table and create a list by using a Joined List column,

when your will have 3 answers lists in the table, the screen should look like this:

4- Now, create a new column using the Template type to merge 3 previous answer lists and have a single and larger answer list:

  1. finally, we need to use a small JS code to avoid creating more columns and got the final results you are looking for!

the JS code is this:

const arr=p1.split(",")
x= arr.filter(function(valor)  {
       return valor == p2;
      }).length 
return x

I suppose that another no-code idea/solution (100% pure) can be used here but this is very efficient and quick to avoid creating many columns.

Espero te sirva y puedas seguir avanzando en tu APP!

Saludos @Priscilla_Garcez

1 Like

Do you mean it should be counted for each user or for all users?

Say should the final form be like your “a”, “b”, “c” columns, or do we have to sum them all to get a: 2, b: 5 and c:2?

2 Likes

Ah!! for this case the solution is faster… :sunglasses:

She would need to create 3 new columns and type this code in each one (base on her answers type):

I tried to use CountIF() formula (Excel plugin) in order to avoid the JS code and have a pure No-Code solution but I couldn’t find the right syntax to get a value.

It would be great to know the right syntax and use CountIF() formula from now on.

Saludos!

3 Likes

This was exactly and precisely what I needed! Thanks a lot!
I’m new to Glideapp, this is my first project. Still learning everything, haven’t gotten around to learning code yet.
Thank you so much @gvalero and @ThinhDinh ! I appreciate it. I’m glad that the forum works so well and has people willing to help beginners.

2 Likes

We’re always here to help, and @gvalero rocks as always.

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.