Whether you regularly connect various spreadsheets to create impressive reports or only use Google Sheets once a month to update numbers, every online marketer should have the following Google Sheets functions in their toolbox.
These functions are not only incredibly useful for efficiently performing calculations in your spreadsheets, but they also open up new possibilities, allowing you to automate more tasks and achieve even better results.
Today, Part III: ARRAYFORMULA. This function helps you apply formulas in bulk to a range, ensuring that you don’t accidentally skip rows and that you use the same formulas consistently throughout.
ARRAYFORMULA

What do you use ARRAYFORMULA for?
In feed management, it's common to have a spreadsheet with data where you want to apply a formula to all rows. You could, of course, enter your formula in row 2 and drag it down until it's applied to all rows.
But if your data is dynamically loaded, for example with an IMPORTDATA function, the number of rows in your spreadsheet may vary. Of course, you could manually apply your formula to the new rows each day, but it’s preferable to use a method that achieves this dynamically.
And that’s where ARRAYFORMULA comes in. This function allows you to apply your usual functions to entire columns at once, instead of individual cells.
How do you use ARRAYFORMULA?
Suppose you have an XLOOKUP formula in B2 that looks like this, to find the value from column F of another sheet based on a value in column A: =XLOOKUP(A2, ‘Ad Group Report’!A:A, ‘Ad Group Report’!F:F, “Not Found”)
If you drag this formula down, you’ll get the following formula in B3, where only the lookup value changes: =XLOOKUP(A3, ‘Ad Group Report’!A:A, ‘Ad Group Report’!F:F, “Not Found”)
But if you adjust the formula in B2 to an ARRAYFORMULA, it might look like this: =ARRAYFORMULA(XLOOKUP(A2, ‘Ad Group Report’!A:A, ‘Ad Group Report’!F:F, “Not Found”))
The lookup value then changes to an array (A2:A1000) instead of a cell reference (A2). Combined with XLOOKUP, Google Sheets will go through all the rows to look up values from A2 to A1000 and return the corresponding values from column F in the Ad Group Report.
ARRAYFORMULA bonus tip 1:
To prevent your formula from being applied to empty rows, it’s useful to always add an IF statement at the start of your ARRAYFORMULA. For example: =ARRAYFORMULA(IF(A2 =””, ””, XLOOKUP(A2:A, ‘Ad Group Report’!A:A, ‘Ad Group Report’!F:F, “Not Found”))
In this case, it first checks if the value in column A is empty (“”). If so, it immediately returns a blank value. If not, the XLOOKUP is performed. This prevents the XLOOKUP from running unnecessarily and returning 'Not Found' for all empty rows.
Another option is: =ARRAYFORMULA(IF(LEN(A2:A), XLOOKUP(A2:A, ‘Ad Group Report’!A:A, ‘Ad Group Report’!F:F, “Not Found”), “”)
In this case, it first checks the length of the value in column A. If it is 1 character or longer, the XLOOKUP is applied; otherwise, a blank value is returned.
ARRAYFORMULA bonus tip 2:
To make your ARRAYFORMULA even more dynamic, you can use A2:A instead of A2:A1000 as the array. This ensures that if your spreadsheet contains more than 1,000 rows, the formula will still apply to rows beyond the thousandth row.
Be careful not to leave too many empty rows in your spreadsheet, as this can cause your spreadsheet to become unnecessarily slow.
ARRAYFORMULA bonus tip 3:
Because ARRAYFORMULA fills multiple cells with values from a single cell, it’s helpful to mark the source cell (where the formula is located) in yellow and the cells filled by it in light orange (see example above).
This prevents you from accidentally editing values that fall within this result vector, which could lead to #REF! errors. If you use several of these formulas next to each other, use slightly different shades of orange or other colors for each result vector.
ARRAYFORMULA bonus tip 4:
Unfortunately, not all regular formulas work equally well with ARRAYFORMULA. For example, XLOOKUP works fine, but if you want to use SUMIFS within an ARRAYFORMULA, you’ll quickly notice that the results are incorrect. This is because SUMIFS already expects an array as input, which prevents it from functioning correctly with ARRAYFORMULA.
In such cases, there are a few workarounds to make ARRAYFORMULA work (by cleverly using functions like FILTER, XLOOKUP, or TRANSPOSE), but it’s usually easier to use the BYROW function instead of ARRAYFORMULA. More on this later 🙂

