Click here to Skip to main content
15,881,559 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a spreadsheet with four columns:

XML
question_id  user_id   unique_question_ids   # of unique_user_ids
 X            11        X                     ? (=2)
 X            12        Y                     ? (=3)
 X            12
 X            12
 Y            13
 Y            14
 Y            15


The first two columns are questions and their corresponding users and include repeats of both.

The objective is this: I want to count the number of unique users for each unique question.

I started with first finding the unique_questions which I found using the UNIQUE function. This listed what questions are unique in the unique_question_ids column (i.e. X, Y)

Now I want to count the number of unique users that each unique question has? The other problem is that I do not know where X and Y start, however they are still sorted in order (real spreadsheet is very large).

How would I go about doing this? I am thinking I could use COUNTIFS but this doesn't count for unique values. I also thinking of using a function that would return the range of where X or Y is located in the question_id column, and then count in the next column (i.e. user_id) for unique values. But I cannot find a function that returns the cell range of a value in a column. I am also doing this on Google Spreadsheets.

Any thoughts or ideas would be appreciated, thanks
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900