How to Optimize XLOOKUP Performance in Large Excel Workbooks
Question details
The user wants to improve calculation speeds and optimize overall performance when using XLOOKUP formulas in large Excel workbooks, particularly with massive tables or external data.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Working with large datasets where multiple XLOOKUP calculations cause significant slowdowns, lags, or freezing.
- Observed behavior
- Excel becomes slow to calculate, unresponsive, or freezes due to the heavy computational load of numerous or complex XLOOKUP formulas referencing large tables.
Before making structural changes to your formulas, ensure your Excel workbook is set to Manual Calculation mode (Formulas > Calculation Options > Manual) to prevent Excel from freezing while you edit the formulas.
Use XLOOKUP's Binary Search Mode
Switching from the default linear search to binary search can drastically reduce calculation times for large datasets, provided the lookup array is sorted.
By default, XLOOKUP searches row by row (linear search). If your dataset is large, this is extremely slow. A binary search splits the dataset in half repeatedly to find the value, which is exponentially faster but requires the data to be sorted.
Select your lookup table and sort it by the key column (the column you are searching in) in ascending order.
Navigate to the cell containing your XLOOKUP formula.
Update the formula to include the 6th argument for search mode. Enter a formula like =XLOOKUP(A2, LookupTable[Key], LookupTable[Value], "", 0, 2). The '2' specifies a binary search for data sorted in ascending order.

Consolidate Formulas with Dynamic Arrays
Replacing thousands of individual XLOOKUP formulas with a single spilled dynamic array formula can significantly improve memory usage and calculation speed.
Offload to Power Query
When your workbook contains hundreds of thousands of rows, performing joins in Power Query is much more efficient than using cell-based lookup formulas.
Process Large Datasets Smoothly with WPS Spreadsheet
WPS Office provides a highly optimized Spreadsheet application that fully supports modern functions like XLOOKUP and dynamic arrays. It is designed to handle large datasets efficiently while maintaining 100% compatibility with Microsoft Excel files.
- 1. Install the software: Download and install WPS Office on your PC or Mac.
- 2. Open your large dataset: Launch WPS Spreadsheet and open your large .xlsx file containing the lookup data.
- 3. Apply XLOOKUP formulas: Use =XLOOKUP() exactly as you would in Excel, leveraging WPS's fast calculation engine.
- 4. Save your work: Save your optimized workbook seamlessly in the standard Excel format without compatibility issues.

Frequently Asked Questions
Why is XLOOKUP making my Excel workbook so slow?
By default, XLOOKUP performs a linear search, checking every row from top to bottom. If you have hundreds of thousands of rows or are referencing full columns (like A:A), this requires massive computational power and memory, resulting in slow performance.
Can sorting my data really speed up XLOOKUP?
Yes. If you sort your lookup array and change the XLOOKUP search_mode argument to 2 (binary search ascending) or -2 (binary search descending), Excel splits the data in halves rather than checking row by row. This finds the match exponentially faster.
Is Power Query faster than XLOOKUP for merging tables?
For very large datasets (e.g., over 100,000 rows), Power Query is generally much faster and more stable than using thousands of XLOOKUP formulas. It processes the merge in the background and only outputs the final values, drastically reducing the active calculation load in your workbook.
Should I avoid using full column references with XLOOKUP?
Yes, avoiding full column references (like A:A or B:B) is highly recommended. Even though modern Excel handles empty cells better than older versions, full column references still force the engine to process a larger range than necessary. Always use exact table ranges or Excel Tables (ListObjects) instead.




