Skip to main content
Solved

#ERROR with SUBSTITUTE Formula

  • August 13, 2024
  • 2 replies
  • 26 views

Forum|alt.badge.img+4

I have two tables:

  1. Key Source Formula
  2. Sources

Within the Key Source Formula table I have a field called URL Format

An example entry is:   https://www.website.com/search/?q="Company"&t=week

In the Sources table I have a value called Company Name Text
e.g. Apple, which I want to substitute into the URL Format. This should return a result like:

https://www.website.com/search/?q=Apple&t=week

The SUBSTITUTE formula I have is:

SUBSTITUTE({URL Format}, "Company", {Company Name Text})

It returns #ERROR.

I have even used the Airtable AI to write this formula and it doesn't work.

Any help much appreciated

Best answer by hunter86

Solved by Copilot.

Sometimes, adding an empty string to the fields can help convert them to text. Try modifying your formula to:

SUBSTITUTE({URL Format} & "", "Company", {Company Name Text} & "")

2 replies

Forum|alt.badge.img+4
  • Author
  • New Participant
  • Answer
  • August 13, 2024

Solved by Copilot.

Sometimes, adding an empty string to the fields can help convert them to text. Try modifying your formula to:

SUBSTITUTE({URL Format} & "", "Company", {Company Name Text} & "")

Forum|alt.badge.img+4
  • New Participant
  • September 20, 2024

Thanks, I had the same problem and this solved it! Don't understand the logic, but it worked!