Professional Documents
Culture Documents
XL 03 12 Array Functions Customers Data Before
XL 03 12 Array Functions Customers Data Before
Sales Data and Statistics by Year: Database Functions to Summarize Sales and Orders: What IS an "array function?" It's a way to change an
Total Average Total # of Total Minimum Maximum
Year: Sales: Order Size: Orders: Commissions: Order: Order: State Amount Order Date Sales Rep ID Some functions are already designed to do this - exa
2016 $ 969,030 $ 138,433 7 But others are not! Examples include IF, IFERROR, th
2017 2,965,850 164,769 18
2018 6,211,826 200,381 31 Order Total: And then some built-in functions, such as TRANSPO
2019 12,074,872 232,209 52 Order Count:
2020 22,000,859 275,011 80 Commission Total: To enter an Excel function as an array function, you
2021 33,973,085 311,680 109 Doing this will automatically create "curly braces" -
2022 42,930,202 343,442 125
2023 61,048,714 388,845 157 To illustrate, let's rewrite SUMPRODUCT function u
2024 90,993,446 497,232 183
2025 135,147,098 570,241 237 NOTE: As I record this, Microsoft is in the process of
2026 combo when entered, and offer some other advanta
Year: Year
Revenue:
Revenue Growth:
Net After Commissions:
Selected Data:
Select Year: 2025 Sales by Sales Rep - 2025 Data for Min/Max Order Size Chart:
Year
What IS an "array function?" It's a way to change an existing function in Excel so that it can operate on multiple values or cells instead of just a single value or cell. Note that modern versions of Excel contain the MAXIFS and MINIFS functions already, so this is not necessary
Some functions are already designed to do this - examples are SUMPRODUCT, SUMIF, and SUMIFS. We can build our own MAXIF and MINIF using array functions, as follows:
But others are not! Examples include IF, IFERROR, the *, /, +, and - operators, etc.
=MIN(IF((Orders!$J$3:$J$1000>=B7)*(Orders!$J$3:$J$1000<Summary!B8)>0,Orders!$I$3:$I$1000,""))
And then some built-in functions, such as TRANSPOSE, need to be entered as array functions in order to work properly.
The first IF statement just checks the criteria, and gives us 1 * 1, or TRUE, if both are true, and if not, 0 * 1 or 1 *
To enter an Excel function as an array function, you type Ctrl + Shift + Enter rather than the normal Enter after finishing the formula.
Doing this will automatically create "curly braces" - { } - around the formula. DO NOT ENTER THESE YOURSELF OR TRY TO MODIFY THEM! Then, if it's TRUE, the function gives us the corresponding Order Dollar Amount in column I. We get a collection
meet these criteria at the end, and then we run the MIN function on this.
To illustrate, let's rewrite SUMPRODUCT function using an array function and multiplication over ranges of cells here.
If it's false, we must use the "" to denote blank text because if we enter 0, 0 will always be the MIN of this set
NOTE: As I record this, Microsoft is in the process of "replacing" traditional array functions with "dynamic array functions" that do not require the Ctrl + Shift + Enter
combo when entered, and offer some other advantages… but these legacy functions will still work, so we're sticking to them here. Why can't we do this using AND instead of the multiplication operator?
Revenue Revenue Growth Avg. Order Size # Orders Short answer is that AND doesn't work this way within array functions, and Excel won't be able to tell that it sho
AND will evaluate the condition against the entire range of dates rather than going row-by-row, so the conditio
You might, however, be able to write this with nested IF functions or something similar.
You can also use the =TRANSPOSE function to convert a column to a row, or a row to a column. Very common
1) You must select the entire range of cells you want to apply it to before entering it.
2) When you enter it, you must press Ctrl + Shift + Enter.
3) After entering it, you can't modify individual cells within the output range - must delete and re-enter everyth
1 1 And so on - Microsoft is removing some of these limitations with dynamic array functions, but you'll still see ma
Revenue Revenue Growth Year Average Order Size
Total # of Orders
Grand Total
nd MINIFS functions already, so this is not necessary anymore - but it is a good practice exercise. Use this to bring in the valuation multiples from the Public_Comps and MA_Comps sheets as well as the Company Figures - should be a fairly simple task.
You will need multiple TRANSPOSE functions to do this because the cells are not contiguous.
0<Summary!B8)>0,Orders!$I$3:$I$1000,"")) BONUS: One Other Use Case for Array Functions - Reversing the Order of a List
1 * 1, or TRUE, if both are true, and if not, 0 * 1 or 1 * 0 or 0 * 0, all of which are 0, meaning FALSE. 2 5
7 1
Order Dollar Amount in column I. We get a collection, or array, of these Order Dollar Amounts that 4 4
1 7
5 2
se if we enter 0, 0 will always be the MIN of this set of numbers! "" makes Excel throw out the result.
=INDEX(AM10:AM14,ABS(ROW(INDIRECT("1:"&COUNTA(AM10:AM14)))-(COUNTA(AM10:AM14)+1)))
You can think about how this works yourself - we don't have time to get into it here, and it's not super-important, but it can be useful.
ay functions, and Excel won't be able to tell that it should evaluate the part inside by going line by line.
f dates rather than going row-by-row, so the conditions will never be true there. HINT: We need to retrieve from the 5th row, then the 4th row, then the 3rd row, etc… so we need to create an array like {5, 4, 3, 2, 1}.
nctions or something similar. Think about how to do that… look at the row # in each case and then subtract (the total # of rows + 1), and flip to positive.
olumn to a row, or a row to a column. Very common in data analysis and financial models.