Formula Errors

Fix Dynamic Array Formula for Subtraction of Last Nonblank Cells

Anum MushtaqAnum Mushtaq Nov 10, 2026 869 views

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.

How to Fix a Dynamic Array Formula for Subtraction in Spreadsheets
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.
Before you start

Ensure that your spreadsheet software is updated to a version that supports modern dynamic array functions such as LET, FILTER, TAKE, and DROP.

Solution 1Recommended

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.

1
Select the target cell

Click on the cell where you want the final subtraction result to be displayed.

2
Input the dynamic array formula

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)),"")

3
Execute the formula

Press the Enter key to calculate the result. The formula will automatically ignore blank cells and compute the difference.

Apply the Correct LET, TAKE, and DROP Formula
How this formula works: This formula efficiently filters out blank cells, checks if the last two values are identical, and subtracts the last value from the previous one. If an error occurs, it leaves the cell blank.
Advanced Formula Support

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. 1. Install WPS Office: Download and install WPS Office on your computer from the official website.
  2. 2. Open your workbook: Launch WPS Spreadsheet and open your existing Excel workbook containing the dynamic array formulas.
  3. 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. 4. Calculate instantly: Press Enter to instantly calculate dynamic arrays without any compatibility issues or lag.
Seamless compatibility with Microsoft Excel formulas and file formats (.xlsx)Built-in support for advanced modern array functionsLightweight and fast performance, even for large datasetsFree to download and easy to migrate your existing workflows
microsoft office alternative - wps office

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)).