1

Here, I have a list of red coloured fruits, and a list below it, of yellow coloured fruits, as you can see.

Here, I have two drop-down lists used to select colours and fruits. When selecting "Red", in the drop-down list on the left, I would like the list on the right to show the list of red coloured fruits only. When selecting "Yellow", in the drop-down list on the left, I would like the list on the right to show the list of yellow coloured fruits only. What kind of formula do I use to do that?

1 Answer 1

1

I would create a formula like this. The red fruit is listed in column AA. The yellow fruit is listed in column AB.
=IF(A1="Red",OFFSET(AA2,0,0,COUNTA(AA2:AA10),1),IF(A1="Yellow",OFFSET(AB2,0,0,COUNTA(AB2:AB10),1)))

In the data validation list for the cell to select the fruit input that formula above.

How it works

The IF statement evaluates the color of the fruit selected. The OFFSET command will create a list starting at the top of the selected color fruit list. The COUNTA formula counts the number of fruit in the column (up to 10 fruit).

3
  • 1
    I don't know how to use the offset function. Can you explain step-by-step what do I do, please? Thanks :) Aug 4, 2015 at 5:03
  • Got it working, you're super awesome! Thanks a lot! Marked as accepted answer! Aug 4, 2015 at 5:47
  • But the formula is confusing, like if I wanted instead of having red fruit in column AA, I wanted it in column AM for example, how do I do that? I tried changing the AA to AM normally, but it caused an error, that's why I'm asking. Aug 4, 2015 at 5:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .