The LET Function

Let’s say you want to extract the domain from an email address in your Google Sheet.

You could easily do this with the following formula:

=RIGHT(A1, LEN(A1) - FIND("@", A1))

However, if you need to apply this to a different cell, you’d have to update the cell address (A1) in three places within the formula. This is where the LET function becomes incredibly useful.

With LET, you can streamline the formula like this:

=LET(email_cell, A1, RIGHT(email_cell, LEN(email_cell) - FIND("@", email_cell)))

The LET function allows you to assign a name to a value or a calculation within a formula. It takes the variable name (e.g., email_cell), the value or reference you want to assign to it (e.g., A1), and then the formula where you want to use that variable. This makes your formulas cleaner, easier to read, and simpler to modify.