Array Formulas
Array Formulas
https://www.vertex42.com/blog/excel-formulas/array-formula-examples.html
This workbook contains examples from the article "Excel Array Formula Examples." Regarding copyright and s
of this file like a book. You may use the ideas and techniques and formulas explained here, but you may not re
worksheet or copy substantial portions from it, just as you would not do so with a book. Thank you. - Jon Wittw
EXAMPLES
MAX-IF Find the last Date that Bob was Contacted Person
=MAX(IF(contact_range="Bob",date_range)) Jim
Bob
NOTE The FALSE values returned by the IF formula are not treated as 0 values by the LARGE
and SMALL functions. If SMALL treated FALSE values as 0 values, the formula would not
work.
SUM-IF Find the total Sales for Jim and Bob Person
=SUM(IF(contact_range="Bob",sales_range)) Jim
Bob
Values
67
23
#N/A
#NAME?
blank
=""
Formula: =ROW(1:5)
Formula: =ROW(INDIRECT(n&":"&m)) n
5
m
7
NOTE The results are showing only the first 3 values of the array. Try making n = m in this
example to see what happens. Also note that when the multi-cell array result is larger than
the array the formula returns, the array is filled with NA() errors.
NOTE In this example, we can't create a multi-cell array formula that changes in size. So, it's only
the first 3 values that are shown. However, you can use a variable length array like this
within other array formulas.
Matrix Formulas
Excel provides some key functions for working with matrices. These include MUNIT for creating the identity ma
for matrix multiplication, TRANSPOSE for transposing a matrix or vector, MDETERM for calculating the determ
MINVERSE for calculating the inverse of the matrix. Formulas for some key matrices and matrix manipulation
demonstrated below.
I= =MUNIT(n)
I= 1 0
0 1
j= =c+0*ROW(INDIRECT("1:"&n))
J= =c+IF(ISERROR(OFFSET(INDIRECT("A1"),0,0,n,m)),0,0)
j= 1 J= 1 1 1
1 1 1 1
1 1 1 1
INDIRECT and OFFSET or volatile functions. If you have access to the MUNIT function, then a simpler way to
ones matrix is to multiply the Identity matrix by 0 and add 1. The vector can be obtained using INDEX to return
column.
j= =INDEX(c+0*MUNIT(n),0,1)
J= =c+0*MUNIT(n)
j= 1 J= 1 1 1
1 1 1 1
1 1 1 1
Formula: =MMULT(b,TRANSPOSE(INDEX(1+0*MUNIT(k),0,1)))
x= 1 X= 1 1 1 1
10 10 10 10 10
100 100 100 100 100
x= 1 10 100 1000
X= 1 10 100 1000
1 10 100 1000
1 10 100 1000
C= =MMULT(A,B)
A= 1 2 B= 2 C= 8
3 4 3 18
A 1 2 AT 1 3
3 4 2 4
A 1 56 76 Diagonal 1 0
24 2 98 0 2
34 46 3 0 0
Formula: =b * MUNIT(ROWS(b))
b= 1 Diagonal 1 0 0
2 0 2 0
3 0 0 3
Formula: diag(A) =
A= 1 56 76 diag(A)= 1
24 2 98 2
34 46 3 3
A 1 56 76 trace(A)= 6
24 2 98
34 46 3
A 1 56 76 |A| = 256794
24 2 98
34 46 3
REFERENCES
Array Formula
24.05%
SUMPRODUCT
24.05%
ay formulas.
Last Contacted
9/10/2017
8/5/2017
Largest Sale
$ 1,000.00
$ 300.00
n Result
2 $ 500.00
n Result
2 $ 300.00
Total Sales
$ 1,700.00
$ 300.00
1st 3 Values
1
2
3
1st 3 Values
5
6
7
ing n = m in this
ray result is larger than
1st 3 Values
7
8
9
1st 3 Values
43101
43102
43103
0.0207793
0.00672134
-0.00522598