Formula Patterns

Use LET and ARRAYFORMULA with SheetsFinance

Google Sheets LET and ARRAYFORMULA work with SheetsFinance to reduce repeated calls and apply the same operation across a range.

Reuse a value with LET

LET lets you name a value once and reuse it in the same formula. This is useful when you need the same price or metric more than once.

Example: calculate the spread between a stock price and a converted currency value.

=LET(
  price, SF("AAPL"),
  fx, SF("USDEUR"),
  price * fx
)

Apply an operation across a range with ARRAYFORMULA()

ARRAYFORMULA() wraps a formula so it runs across every cell in a range. Use it with SheetsFinance when you want to divide, multiply, or format a whole column of output at once.

Example: convert percentage changes from basis points to decimal values.

=ARRAYFORMULA(SF("AAPL", "change", "5D&1M&1Y", "NH") / 100)

Note: You can also use the formatting option decimal to run this conversion from within the Price Change function like so SF("AAPL", "change", "5D&1M&1Y", "NH&decimal")

Example: apply a custom calculation to every symbol in a column.

=ARRAYFORMULA(SF(A1:A10) / SF(A1:A10, "realTime", "eps"))

Combine LET and ARRAYFORMULA

Use LET inside ARRAYFORMULA to avoid fetching the same rate or reference for every row.

=ARRAYFORMULA(LET(
  fx, SF("USDEUR"),
  SF(A1:A10) * fx
))

When to use it

  • Use LET when a formula repeats the same SheetsFinance call two or more times.

  • Use ARRAYFORMULA when you want the same arithmetic applied to every row in a column without dragging the formula down.

  • Do not use ARRAYFORMULA to batch symbols for SF; SF already natively accepts ranges like A1:A100 as a single call.

What is next

For more on batching symbols, read Batch symbols to reduce formula calls. For single-cell extraction, see Get a single value from a multi-row function.

Was this helpful?