In Excel you can perform some powerful and useful operations using array formulas. This Tutorial together with the examples in the workbook introduces basic array and application of more advanced formulas.
An array formula is a formula that can perform multiple calculations on one or more of the items in a range. Array formulas in Excel workbook can be placed either:
In most cases array formulas use standard Excel formula syntax however a trick is needed to complete the coding.
Screenshot 1: Data for Example
Refer to the Screenshot 1. The first set of steps in this example uses a multi-cell formula to calculate a set of revenues. The second formula uses a single-cell formula to calculate total revenue.
How to calculate revenue for each product using array formula?
{=F8:F22*G8:G22} or {=Quantity*Price}
Screenshot 2: Multi-cell array formula
Screenshot 3 shows how to calculate total revenue in a single-cell array formula
{=SUM(Quantity * Price)}
Screenshot 3: Single-cell array formula
This component of array formulas called array constants, where you need to add sets of values that don't change (such as names) to your array formulas. TRANSPOSE function can be used to convert the range from column to row or vice versa. Refer to examples in the workbook.
The examples here show you some useful ways to apply advanced array formulas. Refer to Screenshot 4, the entered array formulas are highlighted in blue.
The Excel functions do not work when you try to calculate a range that contains an error value such as #N/A. These formulas ignore the errors.
{=SUM(IF(ISERROR(RANGE),"",RANGE))}{=MIN(IF(ISERROR(RANGE),"",RANGE))}{=AVERAGE(IF(ISERROR(RANGE),"",RANGE))}This example shows you how to remove zeros from a range when you need to calculate the minimum or average the values in that range.
{AVERAGE (IF(RANGE<> 0, RANGE))}
{MIN (IF( RANGE<>0,RANGE )}You often need to sum values based on conditions. For example, this array formula sums just the positive integers in the range:
{=SUM(IF(RANGE>0,RANGE))}You can also sum values that meet more than one condition such as shown in Screenshot 5.
This might be useful when we are doing reconciliation. To use this formula, the cell ranges must be the same size and of the same dimension.
{=SUM(IF(RANGE1= RANGE2,0,1))Screenshot 4: Advanced array formulas