# How to restrict an answer because of a prior answers value

Hi all,

I’m currently trying to refine my form through kobo and xls forms.

I have an initial question of How many days in the past week has your household eaten vegetables? The answer can be between 0-7, through a range function

I have a question leading from this, How many days in the past week has your household eaten green leafy vegetables? I want this answer to be restricted to equal or less than the answer for overall vegetables.

Any tips on how to do this? I was thinking of a constraint or if function, but struggling with the right formula

Ben

Hello benmcdermott,

You can use constraint formula .<= \${Q1}

Q1. How many days in the past week has your household eaten vegetables?
Ans: Between 0-7

Q2. How many days in the past week has your household eaten green leafy vegetables?

In the Q2 you can use Constraint formula like this .<= \${Q1}. This way Q2 answer would be less than 7 or equals to Q1 answers

Regards,
Dinesh Dongol

2 Likes

Thankyou for replying, that works perfectly!

Much appreciated