How to Display a Selected Excel Column and Run Formulas from a Drop-Down
Question details
The user needs to display a specific column of data based on a drop-down selection and dynamically execute associated calculations using dynamic array functions.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Creating dynamic reports or calculators where data columns and formula logic change based on a user's drop-down menu selection.
- Observed behavior
- The user wants to fetch the correct column data dynamically and apply the appropriate specific formula without manually changing functions, avoiding incorrect reference results.
Ensure your spreadsheet headers exactly match the text options in your drop-down list, as trailing spaces or typos will cause the matching functions to fail and return an error.
Use Dynamic Array Functions (CHOOSECOLS, XMATCH, LAMBDA)
Utilize modern Excel functions to cleanly extract the chosen column and map customized calculations across arrays.
This approach uses CHOOSECOLS to dynamically return an entire column based on a drop-down selection. It combines MAP and LAMBDA to cleanly execute specific formulas corresponding to the choice without complex nested IF statements.
Enter the formula =CHOOSECOLS(H3:L999,XMATCH(V7,H1:L1)) in your target cell. Here, V7 is your drop-down, and H1:L1 are your headers.
Open the Name Manager via Formulas > Name Manager, and define custom LAMBDA functions for your different calculations (e.g., FofT_A, FofT_B).
Use the formula =MAP(N3:N999,LAMBDA(T,CHOOSE(XMATCH(V8,H1:L1),FofT_A(T),FofT_B(T),FofT_C(T),FofT_D(T),FofT_E(T)))) to apply the correct LAMBDA function to your data array based on the drop-down in cell V8.

Use Traditional INDEX/MATCH and Nested IF Statements
A backward-compatible method for older spreadsheet versions that do not support dynamic arrays.
Build Dynamic Spreadsheets with WPS Office
WPS Office Spreadsheet provides powerful formula calculation capabilities, fully supporting array functions and advanced lookup formulas to help you build interactive and dynamic data tables effortlessly.
- 1. Create a drop-down list: Open your worksheet in WPS Spreadsheet, select the target cell, go to the 'Data' tab, and click 'Validation' to set up a List based on your headers.
- 2. Enter your dynamic formula: Click the cell where you want the result and input your lookup formula (e.g., INDEX/MATCH or dynamic array functions) referencing the drop-down cell.
- 3. Manage named ranges: Go to the 'Formulas' tab and use the 'Name Manager' to define specific ranges or custom calculations to keep your formulas clean and highly maintainable.

Frequently Asked Questions
Why does my CHOOSECOLS or XMATCH formula return an #N/A error?
This usually happens when the text in the drop-down list does not exactly match the header row text. Check for hidden spaces or spelling differences between the drop-down options and the headers.
Can I use these dynamic array formulas in older spreadsheet versions?
Functions like CHOOSECOLS, MAP, and LAMBDA require newer software versions. For older versions, you must use the traditional INDEX and MATCH combination paired with nested IF functions.
How do I create the drop-down list used in these formulas?
Select your target cell, go to the Data tab, click Data Validation, choose 'List' under the Allow dropdown, and either manually input your options separated by commas or select the header range as your source.




