How to Create an Excel Formula Based on Dropdown Text and Decimal Places
Question details
The user needs an Excel formula that outputs 100 if a specific dropdown cell contains 'UP', and if it contains 'DOWN', calculates a return value based on the number of decimal places found in a different target cell.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Building a conditional formula that reacts to a data validation dropdown list and dynamically reads the text length or decimal count of numeric input.
- Observed behavior
- Previous attempts to write the formula resulted in #VALUE! errors and missing parenthesis warnings when calculating the DOWN condition.
Before applying the formula, verify that your dropdown list is correctly set up using Data Validation, and ensure the target cell contains valid numeric data so the text functions can evaluate the decimal places properly.
Use Nested IF, TEXT, and CHOOSE Functions
This solution uses nested IF statements to check the dropdown value. For the 'DOWN' condition, it converts the target number to text to measure its length, applying the CHOOSE function to return specific values based on that length.
By combining ISNUMBER, LEN, and TEXT, you can effectively evaluate the format of a number. The CHOOSE function then maps the resulting string length to your predefined decimal-based outputs (e.g., 0.5, 0.15, or 0.255).
Locate the cell containing your UP/DOWN dropdown (e.g., B2) and the cell containing the numeric value you want to evaluate for decimal places (e.g., A2).
Select your result cell and type the following formula: =IF(B2="UP",100,IF(B2="DOWN",IF(ISNUMBER(A2),CHOOSE(LEN(TEXT(A2,"0.0")),0.5,0.15,0.255),""))) . Ensure all quotation marks and commas are typed exactly as shown.
Press Enter. Change your dropdown to 'UP' to confirm it outputs 100. Then change it to 'DOWN' and vary the decimal places in cell A2 to ensure the CHOOSE function returns the correct corresponding values.

Master Complex Conditional Formulas in WPS Spreadsheet
WPS Office provides full compatibility for advanced logical and text functions, making it incredibly simple to build, evaluate, and troubleshoot complex nested formulas involving dropdowns and decimal calculations.
- 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your workbook where the conditional calculations are needed.
- 2. Create the dropdown list: Go to the 'Data' tab on the top ribbon, click 'Validation', and create a list with 'UP' and 'DOWN'.
- 3. Apply the nested formula: Select the target result cell and paste your nested IF formula to link the dropdown with the decimal-checking logic.
- 4. Debug errors easily: If you encounter parenthesis errors, navigate to the 'Formulas' tab and use the 'Evaluate Formula' tool to step through the calculation and find the exact breaking point.

Frequently Asked Questions
Why is my nested IF formula returning a missing parenthesis error?
When nesting multiple IF, ISNUMBER, CHOOSE, and LEN functions, it is easy to forget a closing parenthesis at the end of the formula. Excel and WPS Spreadsheet require exact pairing of opening and closing parentheses. Always check the colored parentheses indicators to ensure every function is properly closed.
Is there another way to count decimal places without using the TEXT function?
Yes. Instead of converting to text, you can use a mathematical approach or string manipulation. For example, the formula =IFERROR(LEN(MID(A2,FIND(".",A2)+1,255)),0) finds the decimal point and counts the characters strictly after it.
How do I fix a #VALUE! error when using the CHOOSE function?
The CHOOSE function triggers a #VALUE! error if its index number (the first argument) is less than 1 or greater than the number of value arguments you provided. Verify that the length calculated by your LEN function matches the number of options you have listed in your CHOOSE arguments.




