# Quota calculation when total in unknown

Hi guys!

I have a tricky question for you:
I need assign a respondent into one of 3 groups (within every category) based on the least count within every group. The issue is that I don't know how many completes or answers will be in the certain category and the total amount depends on how many categories the respondent is consuming. This means that I cannot calculate the quota cell based on difference in answers' amount in each group with the total amount needed.
Ideally, I need to compare the answers' amount into each of 3 groups and than assign a respondent into one that has the least count.

+1 vote
Hi Alex,

I believe you can accomplish this by creating a quota question for each category.  Here's an example of how I would create the first quota:

(1) Create a new quota question "QuotaCat1."  Give it three cells (with values 1, 2, and 3) and set the cell limits to something like 9999.

(2) Give the first cell this qualification logic:

```(QuotaCellCompletes(QuotaCat1, 1) <= QuotaCellCompletes(QuotaCat1, 2)) AND (QuotaCellCompletes(QuotaCat1, 1) <= QuotaCellCompletes(QuotaCat1, 3))
```

(3) Give the second cell this qualification logic:

```QuotaCellCompletes(QuotaCat1, 2) <= QuotaCellCompletes(QuotaCat1, 3)
```

(4) Set the third cell to "Always qualify."

(5) Later, you can have respondents skip to different parts of the survey using the value stored in QuotaCat1.  "QuotaCat1 = 1" will select the first group, "QuotaCat1 = 2" will select the second, and "QuotaCat1 = 3" will select the third.

Does this work for you?
answered Apr 15, 2016 by Platinum (98,325 points)
Thank you, Zachary. Will try now.