Formula to count text responses - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Formula to count text responses

Last post 06-27-2014 03:39 AM by Kazzahere. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 05-16-2014 03:48 AM

    Formula to count text responses

    Hi I am creating a form using the attached information. I have created the questions, used a drop-down control for the user to select the answer and created a rule for each one so whatever they select provides the code in a text box (e.g. if they answer 1b a code of A (also tried using a number as a result) is received) but how do I calculate the total of each letter to find out which result they have the most of. I don't know anything about code so hoping it's not something that has to be used. Thanks in advance Karen
    Filed under: ,
  • 05-18-2014 11:22 PM In reply to

    Hi Karen,

    I am attaching a simple form which shows how frequent an item has been selected. If you check on the calculated box's formula, it uses a sum formula which I then divided to itself so that each selection would only count as 1 and not the total sum.

    sum(Answer[. = "3"]) / 3

    I'm not sure if this approach will work for you, but using a repeating table I think would be the easiest approach for this scenario. The questions have been inserted in the default values (under the data tab). Of course there are other approaches you can still use if this one doesn't work for you.

    Regards, 

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 05-30-2014 12:56 AM In reply to

    Hi Don Thank you very much for your assistance though am still struggling (hate being a newbie at times). I tried adding in the formula but gave me an error message. I also tried changing the results in A1 etc. to numeric answers rather than letters so that a formula could be created but didn't have any luck. I have attached what I am working on (it's probably all not quite right, just finding my way around). If you are able to assist I would really appreciate it. Thanks Karen
  • 05-30-2014 01:44 AM In reply to

    Re: Formula to count text responses

    Also how do you get the different questions in a repeating table (sorry if that is so simple).
  • 05-30-2014 02:59 AM In reply to

    Re: Formula to count text responses

    Have managed to find out how to put in different questions but don't know how to change the answers as need the user to select from a text answer that is different on each question. Slowly making progress but appreciate any help.
  • 06-03-2014 02:04 AM In reply to

    Re: Formula to count text responses

    Getting desperate now if anyone is able to offer assistance, please. 

  • 06-03-2014 04:34 AM In reply to

    Hi Karen,

    Apologies for not replying sooner. I went ahead and added a few things to your form. Please check the section below for the repeating table. in order for you to add a fixed/permanent row to the repeating table, proceed to the data tab and locate the Default Value button. A windows will appear showing all the fields on your form. Locate the repeating group and add as much repeating fields as desired.  

     

     

    Once you already have a sufficient amount of rows, expand the QuestionList, click on the Question field and enter the question at the Default Value section. I have already created a sum section at the bottom section of your form and have configured the formula for you. Please let me know if this solution works for you.

     

    Regards,

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 06-13-2014 01:08 AM In reply to

    Re: Formula to count text responses

    Wow Don that's amazing thank you so much. My only query is how do I change the drop-down list answers as at the moment the drop down answer box is providing all the same answers which obviously with different questions the answers need to be different.
  • 06-15-2014 02:51 PM In reply to

    Hi Karen,

    The approach I provided you previously with assumed that the answers were similar to all questions since it all had similar values (K,A, V, and R). If you are going to have repeating answer sets, then I would suggest using a hide show logic in order for a drop down to be hidden based on a field which defines the answer type for each row, but if not, let us say you will be having a different set of answers per row then you will need a different formula to add all the values per answer. Your formula now should be:

    count(A1[. = "K"]) + count(A2[. = "K"]) + count(A3[. = "K"]) + count(A4[. = "K"])...... + count(AN[. = "K"]) 

    where N is the last set of answers.

    Please check the attached form.

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 06-27-2014 01:10 AM In reply to

    Re: Formula to count text responses

    Hi Don This looks great, thank you, I think I even understand :-) My only query now is that the rule on the Q fields seems to have change to instead of containing the text in the drop down field it now contains the reference letter so I'm not sure how this is set up (you've done something clever again). I really appreciate your help.
  • 06-27-2014 03:39 AM In reply to

    Re: Formula to count text responses

    Don I think I have actually cracked it. I found the value I previously mentioned, so simple but I never knew you could do that. Am just working on the outcome now so there is a light at the end of the tunnel. I can't thank you enough for your help and the time you put into assisting me.
Page 1 of 1 (11 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.