top of page
  • Writer's pictureAlex English (They / Them)

Why Google Sheets Named Functions are Wicked for SEO

Updated: Dec 18, 2022

In August 2022, Google sheets announced 10 new functions/capabilities. My favourites are the long-awaited XLOOKUP, bringing over that extra, super flexible lookup functionality from Excel; and the ability to create named functions, meaning you can create and save your own custom formulas as re-usable functions for tasks you undertake regularly.


Named functions are wicked for SEO tasks and in this post, I'll outline why, how to create one and share a couple of examples of named functions you can use in your analyses.


Why are named functions so important for SEO?


As SEOs, we spend a lot of time in spreadsheets. We often repeat the same tasks using the same formulas over and over, and that's why taking the time to build templates for common processes is crucial to working efficiently.


Named functions are a game changer for creating re-usable templates that can be easily shared among team members (and across templates), meaning not everyone needs to know the intricacies of those functions, but will still be able to work with those templates, with less margin for error.


Some complex formulas previously needing support from Apps Script to work can now be transferred to named functions, leading to faster execution and more flexibility on where and when those functions can be run in your spreadsheet.


Named functions can be imported from spreadsheet to spreadsheet, so if you know a colleague has solved a particularly tricky problem with an especially convoluted formula, you're able to import the solution into your sheet and you're good to go.


I would recommend starting a log of named formulas among your team where everyone can add solutions to common SEO tasks. This allows every team member to have access to a bank of solutions to help make their Google sheets analyses more efficient.


Starter log of named functions for SEO


Whether it's a set of ranking URLs from Ahrefs, or crawl data from Screaming Frog, I often find myself needing to manipulate a set of URLs from an export.


So, after the named functions announcement, I started compiling a (small) log of named functions I commonly use to extract data from URLs, that I'll keep adding to as and when tasks arise.


You can find the functions GET_DOMAIN, GET_PATH and GET_SLUG in this Extraction Named Functions spreadsheet - all you need to do to use these in your analyses is:

  1. Make a copy of the spreadsheet so you have it in your Drive

  2. Whenever you want to use the functions, simply import them into your working sheet, and follow the steps outlined below on how to import named functions.

How to create a named function


Step 1: Write your function


Write your formula, and make sure to double check that it works! Once you're happy, right click on the cell in which you've written it, and go to the 'View more cell options' button, and then 'Define named function.'

create a named function step 1

Step 2: Name and define your function

name and describe your function

Once you've clicked 'Define named function' a menu will pop out on the right (as you'll see on the right), allowing you to name your function and input details about what it does to give helpful hints to anyone reusing it.


Google sheets will display the function description you write here, when you (or anyone else) type the named function.



Step 3: Add argument placeholders

add argument placeholders to your named function

To ensure named functions can be easily reused, we need to add argument placeholders in the place of cell numbers or ranges.


You can think of these as variables - what needs to change each time a formula is executed, to ensure it executes on the right data.


In this example, the variable is the cell the formula is executing on, and what is in that cell is a URL.


Naming your placeholders (variables) descriptively is incredibly helpful for those reusing your functions - it will help new users to ascertain what the input to the function should be, so if your variable is a URL, name it URL! If your variable is a range of keywords, name it something like keyword_range, so people using your function are guided towards what they need to input to make the

function work.


add additional details to your named function

Step 4: Add additional details


Adding additional details is an optional step that is beneficial to include if you've created a particularly tricky function that requires multiple inputs from a user.


Along with the function description, these additional details will appear when a user is typing in the function, so will help guide them through using the it.


Once you're done with this step, hit 'Create' and your shiny new function will be ready to use in any cell of the your spreadsheet!


How to import named functions


Importing a named function from one spreadsheet to another is super easy. In the toolbar at the top, go to Data > Named Functions, so that the menu bar pops out on the right hand side. To the right of the 'Add new function' button, you'll find one for 'Import function'.


Once you've clicked 'Import function', a popup box will appear, similar to the one that appears when you're importing other files into Google Sheets. Simply navigate to the sheet containing the named function(s) you want to import, and select it. Google Sheets will work its magic and extract the named functions from that spreadsheet and the following popup will appear:

importing named functions

All you need to do is select the formula(s) you want to import, or click import all, and then each of those functions will be available for use in your spreadsheet.


Keyword categorisation template using named functions


One of the first SEO use cases I could see for named functions was keyword categorisation. I've done this in the past using complicated formulas which allows errors to creep in, or using Apps Script, meaning you need to re-run your script each time you make an amendment to your config.


While both methods work, they are not without their challenges, and while I by no means have solved keyword categorisation, I can hope to make it slightly easier and quicker for people out there, with this keyword categorisation with named functions template.


Using 3 named functions, you will be able to easily categorise your keywords by intent, topic and subtopic and see any amendments to your configs instantly in your keyword research sheet. Simply read the README to get going!


To summarise


Named functions are an excellent addition to Google Sheets, allowing for more reusability and flexibility, saving us time and making our analyses easier.


While building complex formulas is fun, building the same one over and over is not so fun (or an effective use of time!), and named functions give us the ability to focus on doing the fun formula build once, and then reaping the benefits an infinite number of times.


If you use any of the named functions in the templates in this post, and have any feedback, please don't hesitate to share it with me - I'm a massive sheets nerd so any improvements that can be made - I definitely want to know!


Learn more about streamlining SEO processes, with my article on uses cases of ChatGPT for SEO.

Comments


bottom of page