Return and Sort Positive Values in an Excel Dynamic Array
Question details
Return all positive values or their complete records in a sorted dynamic array.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A user wants the first, second, and subsequent values greater than zero, along with matching records when needed.
- Observed behavior
- The desired result is a sorted list that spills into adjacent cells and updates when source values change.
Check that you are using Excel for Microsoft 365, Excel 2021, or a later version that supports FILTER and SORT. Identify the numeric criteria column and leave enough empty cells for the results to spill.
Filter and sort positive values in a single column
Use this formula to return every value greater than zero in ascending order.
Click an empty cell outside the source range, such as C2, with space below it for the results.
If the values are in A2:A100, enter =SORT(FILTER(A2:A100,A2:A100>0)) and press Enter.
Review the values below the formula cell. They appear in ascending order and update when values in A2:A100 change.

Return complete rows with positive values
Use this approach when each positive value is part of a record and you want to return the entire row.
Filter and Sort Positive Values in WPS Spreadsheets
In a WPS Spreadsheets version that supports FILTER and SORT, use a dynamic array formula to return positive values and sort them automatically.
- 1. Open the spreadsheet: Open WPS Spreadsheets and use Open to select your Excel workbook.
- 2. Choose an output cell: Click an empty cell outside the source data and leave room for the results.
- 3. Enter the formula: If your WPS version supports FILTER and SORT and the source values are in A2:A100, enter =SORT(FILTER(A2:A100,A2:A100>0)) and press Enter.
- 4. Check the results: Review the spilled values and change a source value to confirm that the results update. If the functions are unavailable, use Data > Filter and sort the filtered values instead; that produces a manual result rather than a dynamic array.

Frequently Asked Questions
How do I return complete rows instead of only positive values?
Use the full record range as FILTER's first argument and the numeric criteria column as its second. For example, =SORT(FILTER(A2:C100,B2:B100>0),2,1) returns matching rows sorted by column B.
Why does my formula show a #SPILL! error?
The output area may contain data or otherwise be blocked. Clear the cells needed for the results and place the formula outside the source range.
How can I sort the positive values from largest to smallest?
Use -1 as SORT's sort-order argument. For example, =SORT(FILTER(A2:A100,A2:A100>0),1,-1) returns positive values in descending order.
What happens if there are no positive values?
Excel's FILTER returns a #CALC! error when no rows match unless you provide an if_empty value. For example, use =FILTER(A2:A100,A2:A100>0,"No positive values").




