Help

Re: Possible to create an If() formula for a lookup field? Especially a text function rather than numerical

Solved
Jump to Solution
799 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Chris_Cunningha
4 - Data Explorer
4 - Data Explorer

Does anyone know if it’s possible to run an if() formula for a keyword in a lookup field. (see screenshots below)

Im looking to return a ‘true’ or ‘false’ if it contains the word “Floorplan” however i believe that the lookup fields are not considered searchable by the formula as it is returning ‘false’ even when the parameters are meet?

Can anyone confirm if my suspicions are true and if so how can i go about making the lookup field compatible so it returns the correct answer in my if() formula

Thanks in advance

Screenshot 2021-04-23 at 10.39.51 Screenshot 2021-04-23 at 10.40.03

1 Solution

Accepted Solutions
kuovonne
18 - Pluto
18 - Pluto

Welcome to the Airtable community!

Using lookup fields in formulas can be tricky because lookup fields are usually arrays, not simple values. One option is to convert the lookup to text string using & "".

IF({Job Requests} & "" = "Floorplan", 'TRUE', 'FALSE')

Also note that this formula will only return "TRUE" if there is an exact match, and not if there are any other words in the lookup.

See Solution in Thread

2 Replies 2
kuovonne
18 - Pluto
18 - Pluto

Welcome to the Airtable community!

Using lookup fields in formulas can be tricky because lookup fields are usually arrays, not simple values. One option is to convert the lookup to text string using & "".

IF({Job Requests} & "" = "Floorplan", 'TRUE', 'FALSE')

Also note that this formula will only return "TRUE" if there is an exact match, and not if there are any other words in the lookup.

Thanks so much! I ended up using the below formula as the word “floorplan” could appear anywhere in the string and along with other words in the lookup field like you mentioned.

(IF(SEARCH(“Floorplan”, {Job Requests}&’’)>0,‘1’,‘0’))

I was then able to use the numerical value in further equations.