Fix Dynamic Array Formula for Subtraction of Last Nonblank Cells
Question details
The user needs a reliable formula to find and subtract the last two nonblank values in a specific row range without triggering argument errors.

- Product
- Spreadsheet
- Device & OS
- not provided
- Scenario
- Calculating the difference between the final two non-empty cells in a row range (e.g., BD3:BO3) for data analysis or tracking purposes.
- Observed behavior
- The current dynamic array formula utilizing LOOKUP, OFFSET, FILTER, and LET is returning a zero or a "too many arguments" error.
Ensure that your spreadsheet software is updated to a version that supports modern dynamic array functions such as LET, FILTER, TAKE, and DROP.
Apply the Correct LET, TAKE, and DROP Formula
Use a streamlined combination of LET, FILTER, TAKE, and DROP to accurately isolate the last two nonblank cells and subtract them.
Older methods using LOOKUP and OFFSET can become overly complex and trigger argument errors. By utilizing newer dynamic array functions, you can cleanly filter out empty cells and extract exactly the positions you need.
Click on the cell where you want the final subtraction result to be displayed.
Type or paste the following formula into the formula bar: =IFERROR(LET(r,BD3:BO3,filled,FILTER(r,r<>""),last,TAKE(filled,,-1),previous,TAKE(DROP(filled,,-1),,-1),IF(last=previous,last,previous-last)),"")
Press the Enter key to calculate the result. The formula will automatically ignore blank cells and compute the difference.

Handle Dynamic Arrays Effortlessly in WPS Office
WPS Office Spreadsheet fully supports advanced array formulas and provides a seamless, fast environment for complex data calculations. You can effortlessly use functions like LET and FILTER to analyze your data without heavy subscription fees.
- 1. Install WPS Office: Download and install WPS Office on your computer from the official website.
- 2. Open your workbook: Launch WPS Spreadsheet and open your existing Excel workbook containing the dynamic array formulas.
- 3. Edit formulas seamlessly: Use the formula bar to input or edit complex functions like LET and FILTER with full syntax highlighting and auto-complete support.
- 4. Calculate instantly: Press Enter to instantly calculate dynamic arrays without any compatibility issues or lag.

Frequently Asked Questions
Why does my dynamic array formula return a 'too many arguments' error?
This error occurs when a function like OFFSET or LOOKUP receives more parameters than it is programmed to handle. It is often caused by misplaced commas or incorrect nesting of multiple functions.
What does the TAKE function do in this specific formula?
The TAKE function extracts a specific number of rows or columns from the start or end of an array. In this solution, TAKE(filled,,-1) extracts the very last nonblank value from the dynamically filtered row.
How does the LET function improve my spreadsheet performance?
The LET function allows you to assign names to calculation results within a formula. This prevents the spreadsheet software from calculating the exact same expression multiple times, which significantly speeds up processing and makes the formula easier to read.
Can I adapt this formula to work for columns instead of rows?
Yes. To use this formula for a column range, adjust the TAKE and DROP function arguments to target rows instead of columns. You do this by changing the position of the -1 parameter (e.g., using TAKE(filled,-1) instead of TAKE(filled,,-1)).




