How to Exclude Blank Specification Rows from a LET Formula in Excel
Question details
The user needs to remove output rows generated by a LET formula when the corresponding specification cell is either blank or contains an unwanted placeholder value such as 'undefined'.

- Product
- Spreadsheet
- Device & OS
- not provided
- Scenario
- Filtering dynamic array outputs created by a LET function to clean up the final data presentation.
- Observed behavior
- The current LET formula outputs all rows, including blanks and placeholders, which disrupts data analysis and needs to be dynamically filtered.
Ensure you have a basic understanding of dynamic array functions, specifically LET, FILTER, and TOCOL, as these are required to process and clean your data arrays effectively.
Use FILTER and TOCOL within the LET Formula
The most efficient way to exclude blank rows and specific placeholders is to flatten the specification data and use it as a logical condition inside the FILTER function.
By assigning the flattened data to a variable within the LET function, you can efficiently evaluate each row without recalculating the array multiple times.
The FILTER function will then evaluate multiple conditions (like not being empty and not matching 'undefined') to return only the valid rows for your final output.
Inside your LET formula, use the TOCOL function to flatten your specification data into a single column. Assign this to a short variable name. For example: `f, TOCOL(data)`.
Set up the FILTER function's include argument to check if the flattened variable is not empty (`f<>""`) and does not equal your placeholder (`f<>"undefined"`). Multiply these conditions to enforce an AND logic.
Wrap your final output array with the FILTER function so it only displays rows meeting the conditions. The complete syntax snippet looks like this: `FILTER(output_array, (f<>"")*(f<>"undefined"))`.

Use WPS Spreadsheet for Advanced Array Processing
WPS Spreadsheet fully supports dynamic array functions including LET, FILTER, and TOCOL. You can easily build complex data processing models and clean up unwanted rows seamlessly.
- 1. Open WPS Spreadsheet: Launch WPS Office and open your workbook in the Spreadsheet application.
- 2. Enter the dynamic formula: Select your target cell and type your LET formula, incorporating the TOCOL and FILTER functions to handle your specifications.
- 3. Press Enter to spill data: Press Enter to execute the formula. WPS Spreadsheet will automatically calculate the array and spill the filtered results, excluding any blank specifications.

Frequently Asked Questions
What does the asterisk (*) do in the FILTER formula?
In spreadsheet array formulas, the asterisk acts as the AND operator. Multiplying two logical conditions, such as (f<>"")*(f<>"undefined"), ensures that both conditions must evaluate to TRUE for a row to be included in the final output.
Why use the TOCOL function in this scenario?
The TOCOL function transforms a multi-dimensional array or range into a single column. This ensures that the specification data aligns perfectly as a 1D array, allowing the FILTER function to evaluate the conditions row by row against the output array.
Can I exclude other specific text strings besides 'undefined'?
Yes. You can add more conditions by continuing to multiply them inside the FILTER function's include argument. For example, adding *(f<>"N/A") to the formula will also exclude rows where the specification contains 'N/A'.
Why am I getting a #CALC! error when using the FILTER function?
The #CALC! error typically occurs if the FILTER function evaluates all the given conditions and finds no matching data. To fix this and display a cleaner result, provide a default value in the third argument of the FILTER function, such as FILTER(output, conditions, "No Data").




