Array Formula Excel Tutorial: How to Use & Examples
In this article
An array formula in Excel performs calculations on multiple values or ranges and returns one or more results. Unlike standard formulas that process single cells, array formulas handle entire arrays—groups of values—making them powerful for complex data analysis.
What Is an Array Formula?
In Excel, an array is a collection of values arranged in rows, columns, or both. An array formula operates on these arrays, enabling advanced calculations such as conditional sums, lookups across multiple criteria, or matrix operations. Before dynamic arrays were introduced in Excel 365 and Excel 2019, array formulas required pressing Ctrl+Shift+Enter to confirm, and they were enclosed in curly braces {} in the formula bar. These are known as legacy or CSE (Ctrl+Shift+Enter) array formulas.
With the introduction of dynamic arrays, Excel now automatically spills results into adjacent cells when appropriate. This innovation eliminated the need for CSE entry in most cases and made array operations more intuitive and scalable. Dynamic array functions like SORT, FILTER, UNIQUE, and SEQUENCE have expanded what users can do without complex legacy syntax.
How Array Formulas Work
Array formulas evaluate multiple values at once. For example, if you want to sum the products of two ranges—say, quantities and prices—you could use a standard formula to multiply each pair and sum the results, or you could use an array formula to do it in one step.
Consider this example: you have quantities in cells A1:A5 and prices in B1:B5. To calculate total revenue:
- Select a cell (e.g.,
C1). - Type:
=SUM(A1:A5 * B1:B5). - In legacy Excel (pre-365), press Ctrl+Shift+Enter. Excel adds
{}around the formula. - In Excel 365 or 2019+, just press Enter.
The formula multiplies each element in A1:A5 with the corresponding element in B1:B5, creating an array of products, then sums them. The operation A1:A5 * B1:B5 produces {A1*B1, A2*B2, ..., A5*B5}, which SUM processes.
Dynamic vs. Legacy Array Formulas
The key difference lies in syntax and behavior:
- Legacy (CSE) Array Formulas: Require Ctrl+Shift+Enter, are enclosed in
{}, and do not spill results. If you need multiple outputs (e.g., fromTREND), you must pre-select the output range. - Dynamic Array Formulas: Introduced in Excel 365, they automatically spill results into adjacent cells. Functions like
FILTERreturn multiple values that “flow” into neighboring cells without special entry.
For example, using =FILTER(A1:B10, C1:C10>100) returns all rows from A1:B10 where the corresponding value in C1:C10 exceeds 100. The results automatically fill the required number of rows and columns.
A common misconception is that all array formulas must use Ctrl+Shift+Enter. This is no longer true in modern Excel. Only legacy functions or manually entered CSE arrays require it. Dynamic functions handle arrays natively.
Common Uses and Examples
Array formulas excel (pun intended) in scenarios where standard functions fall short:
- Conditional Aggregation with Multiple Criteria: Use
SUM((A1:A10="Yes")*(B1:B10>50)*C1:C10)to sum values inC1:C10where column A is "Yes" and column B exceeds 50. - Counting Unique Values:
=SUM(1/COUNTIF(A1:A10,A1:A10))(entered as CSE in legacy Excel) counts unique entries in a range. - Lookup with Multiple Criteria:
=INDEX(C1:C10, MATCH(1,(A1:A10="X")*(B1:B10="Y"),0))finds a value where two conditions are met. - Generating Sequences:
=SEQUENCE(5,3,1,1)creates a 5x3 array of numbers starting at 1, incrementing by 1. - Filtering Data:
=FILTER(A1:C10, B1:B10="Active")returns all rows where status is "Active".
These examples demonstrate how array formulas reduce the need for helper columns and enable real-time, responsive data analysis.
Common Problems and Fixes
Users often encounter issues when working with array formulas:
- Spill Errors (#SPILL!): Occur when dynamic array results can’t expand due to blocked cells. Clear adjacent cells or move the formula.
- Legacy CSE Not Triggered: If results don’t update correctly, ensure you pressed Ctrl+Shift+Enter in older Excel versions.
- Performance Issues: Large array operations slow down Excel. Avoid full-column references like
A:A; use structured references or defined ranges. - Incorrect Results with Boolean Logic: In array formulas,
TRUE/FALSEvalues must be converted to1/0. Use multiplication (e.g.,(A1:A10="Yes")*1) or double negation--( ). - Mixed References: Accidentally mixing absolute and relative references can distort array logic. Use
$consistently where needed.
Always test array formulas on small datasets first. Use F9 in the formula bar to evaluate parts of a formula—highlight a segment and press F9 to see its result.
Frequently Asked Questions
Do I still need to use Ctrl+Shift+Enter?
Only in older versions of Excel (before 365 or 2019) for legacy array formulas. In Excel 365+, dynamic array functions work with a regular Enter.
What is a spilled array?
A spilled array is the range of cells automatically filled by a dynamic array formula. Excel displays a blue border around spilled results, indicating they are linked to the formula cell.
Can array formulas slow down Excel?
Yes, especially with large datasets or volatile functions. To improve performance, limit the range size and avoid using array formulas unnecessarily on entire columns.
Why does my array formula return #N/A or #VALUE!?
This often happens when ranges are mismatched in size or contain incompatible data types. Ensure all arrays in the formula have the same dimensions and contain numeric or compatible values.
Can I use array formulas with VLOOKUP?
VLOOKUP doesn’t natively support arrays, but you can combine it with INDEX and MATCH in an array formula for multiple criteria lookups. However, FILTER or XLOOKUP are better modern alternatives.
Are array formulas compatible with Excel Online?
Dynamic array formulas work in Excel Online. Legacy CSE array formulas are supported but may not display {} in the formula bar, though they still function correctly.