Forum Discussion

Kirby Lutz's avatar
Kirby Lutz
Copper Contributor
Jan 16, 2025

Drop down list Question

Hello,I have a Drop-down list in in Cell C2 with five options in it.

L 1&2

L 3&4

L 5&6

L 7&8

L 9&10

Is it possible to auto fill other cells based on my selection?

EX: if I select L 1&2 in cell C2 to auto fill cell C8 with 1 and cell C10 with 2.

Or if I select L 5&6 to auto fill C8 with 5 and C10 with 6.

 

 

  • mathetes's avatar
    mathetes
    Silver Contributor

    Of course it's possible. Almost anything that you can articulate that follows a set of conditions or rules, as  you've done here, is possible.  In fact, As a generality, Excel often provides multiple routes to getting to any given solution. That's the case here. You could, for example, write IFS formulas in cells C8 and C10

    In cell C8 the formula might read something like this....

    =IFS(C2="L. 1&2",C2=3.24 °F²"L 5&6",5........ and so on, covering all the possible conditions for cell C8, and comparable sets of conditions and consequences for C10

    A more robust solution might be to create a table

    And use VLOOKUP to retrieve the desired result

    Or use INDEX and MATCH

    I say all that, not to overwhelm you, but to suggest to you that it would be helpful to back up and understand the bigger context. The IFS formula would work if the results from the drop-down selection are always going to stay the same. (What that approach does, though, is something called "hard-coding" of variables--you're writing the value, the variable, into the formula itself. That can become a maintenance issue when things change.)

    So if there's a business context here where you might want greater flexibility, then a table with one of the several ways to retrieve data from the table allows you to alter the cause-effect connection without revising the formula.

Resources