+ Reply to Thread
Results 1 to 11 of 11

Array or countifs for counting survey responses

  1. #1
    Registered User
    Join Date
    11-04-2009
    Location
    USA
    MS-Off Ver
    Excel 2008
    Posts
    6

    Array or countifs for counting survey responses

    Ok guys so i've come up with a bit of a problem. I am working on a spread sheet with a ton of data and have not yet found a solution to the following problem.

    I have recorded the data from 12 records (i actually have hundreds, but im just using a small sample). Each record is represented by a vertical column. I want to find the total number of "x's" for only the records from Country1 (from all the answers). Then I want to find the number of "x's" from only Country2. I have tried the "countifs" function but cannot find a way to make it work. Would a different array function be better? How would I write it?

    P.S. The answer for Country1 should be: 15.
    The answer for Country2 should be: 5.
    Attached Files Attached Files
    Last edited by DonkeyOte; 11-04-2009 at 09:06 AM. Reason: Thread Title modified by Mod - OP modified in last post (rather than first post)

  2. #2
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Re: Array or countifs -- cant get it working HELP

    Looking at your data, but how do you come up with 15 for country 1, what range is counted to come up with 15? same for country 2?

    Counting horizontally I come up with 8 for country 1 and 4 for country 2, can't see how you could come up with 15 and 5.
    Last edited by randell.graybill; 11-04-2009 at 01:59 AM.

  3. #3
    Registered User
    Join Date
    11-04-2009
    Location
    USA
    MS-Off Ver
    Excel 2008
    Posts
    6

    Re: Array or countifs -- cant get it working HELP

    Quote Originally Posted by randell.graybill View Post
    Looking at your data, but how do you come up with 15 for country 1, what range is counted to come up with 15? same for country 2?

    Counting horizontally I come up with 8 for country 1 and 4 for country 2, can't see how you could come up with 15 and 5.
    Each RECORD 1, 2, 3, 4, 5 etc is a VERTICAL record of each question. So by starting at record 1 and working VERTICALLY down....we see an x in the country and under that x other x's. I am counting the ANSWERS or the X's in the verticle ANSWERS column for EACH x found as representing the countries column.


    basically if that was too confusing...wherever there is an x in country1 or country 2, im counting and adding up all the x's UNDER (or vertically) in the answers column.

    THANKS SO MUCH FOR YOUR HELP. If i can get this figured out it will save TONS of hours....

  4. #4
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Re: Array or countifs -- cant get it working HELP

    based on how simple the data is you have entered then the follow formula will work
    Please Login or Register  to view this content.
    its not elegant but it worked for the sample set of data you gave.

  5. #5
    Registered User
    Join Date
    11-04-2009
    Location
    USA
    MS-Off Ver
    Excel 2008
    Posts
    6

    Re: Array or countifs -- cant get it working HELP

    I STILL HAVENT FIGURED OUT THE PROBLEM....... The problem is that i have a HORIZONTAL line of over 150 records and a VERTICAL column of probably more than 300 entries. Is there a simpler formula that just uses the ANSWERS columns as an array so that you select all the ANSWER cells and based on whether the COUTRY has an X in it or not it adds the totals?

    So basically in all the data lets say a table of 150 horzontal x's all placed in country 1 or 2 and 300 x's placed VERTICALLY in the answers column, what is a formula that would give me the total X's (or ANSWERS) from Country1 and from Country2 (up to Country15)?
    Last edited by friendlylad; 11-04-2009 at 03:16 AM.

  6. #6
    Registered User
    Join Date
    11-04-2009
    Location
    USA
    MS-Off Ver
    Excel 2008
    Posts
    6

    Re: Array or countifs -- cant get it working HELP

    any one else have any knowledge in how to get this working? i could really use your guys EXPERTISE. Looking forward to the solution.

    thanks

  7. #7
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Re: Array or countifs -- cant get it working HELP

    again not the tidiest solution but look over what it does, if the concept is correct then I'm sure someone else here on the forums can make this thing work more cleanly. I have only recently started actually writing my own code and still am far from expect. But the below code will tell you the same thing as the formula I gave you. And with modification I'm sure can intelligent figure out the rest...but that is the part where I can't go any further.

    To test this out just click on an empty cell on the sample sheet you gave me and it will give you the answer you seek.

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    11-04-2009
    Location
    USA
    MS-Off Ver
    Excel 2008
    Posts
    6

    Re: Array or countifs for counting survey responses

    I am tallying the responses from 100's of surveys. I would like to analyze the data by selecting a conditional response from Question1, and then tally the corresponding responses given in Question2. I have attached a simple Excel example. Remember, there are 100's of surveys (records). How do I write a formula that can be easily repeated?
    Attached Files Attached Files

  9. #9
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Array or countifs for counting survey responses

    friendlylad, thank you for updating your title please note however (going forward) that this is done via editing the first post in the thread - I have on this occasion modified for you - also randell.graybill's prior post has now been reinstanted in lieu of the update.

  10. #10
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Array or countifs for counting survey responses

    In answer to your question

    =SUMPRODUCT(($H$13:$S$13="x")*($H$17:$S$30="x")) --> 15

    =SUMPRODUCT(($H$14:$S$14="x")*($H$17:$S$30="x")) --> 5

    though for the 2nd answer - given the 2 response limit to Q1 you could in fact just use

    =COUNTIF($H$17:$S$30,"x") - result for country1 (ie the 15)

  11. #11
    Registered User
    Join Date
    11-04-2009
    Location
    USA
    MS-Off Ver
    Excel 2008
    Posts
    6

    Re: Array or countifs for counting survey responses

    Thanks for this simple solution! I had not thought of this approach. You guys are great! This will get me going again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1