Skip to main content

Greetings,


I have an Airtable field titled: Course Status and to the right of that field is Total Enrollment. In my Excel spreadsheet version, I used a vlookup to return the value of ‘course status’


The formula: =VLOOKUP(K@Enrolled],Table30,2,FALSE)


Table30

0-2 enrolled = On Standby

3-9 enrolled = Low Enrollment

10-28 = Will Make!


Is there a way to accomplish this in Airtable?


Thanks in advance for your support!


Lisa

Hi,


This was something that I was looking for as well as I needed to do quite a bit of matching between my tables - that were previously using VLOOKUP in Excel. This did not seem to be possible with regular Airtable functions (and I tried a lot of crazy stuff), so I started looking into the Scripting block.

This actually allowed me to make a perfect solution. OK, almost perfect, you still need to change the name of tables and columns manually in the code, but with comments below this should be fairly straight forward.




I have also made a quick video about it:



I hope that helps!


@Greg_F Thank you so much for sharing! One question: How can I make the script to return multiple values if the Barcode is used more than once. I set the Products field up to accept multiple linked records but the script just returns one. Thanks in advance. Christoph


For a No-Code approach to Vlookups in Airtable, we have a function for that in our On2Air: Actions product that can be set up in minutes:





@Greg_F Thank you so much for sharing! One question: How can I make the script to return multiple values if the Barcode is used more than once. I set the Products field up to accept multiple linked records but the script just returns one. Thanks in advance. Christoph


@Greg_F Solved it myself. I was starting from the wrong end, made the products my maintable and order the lookup…


@Greg_F Solved it myself. I was starting from the wrong end, made the products my maintable and order the lookup…


It would be actually also possible to return array as result of search and link array as multiple links in linked field.


Either way - congrats on successfully hacking to a solution!


hi, is there anywhere I could find an easier version of the script to amend, please?



I think it is defined at lines 3. 7, 12, and 17.



Hey Bill -


Wondering if you could help me solve my problem, I am doing something very similar to this , however I have multiple return values for a given search value.


EX) Zip code 10001 exist in a few different cells in my search range, and when I run my function it only diplays one value apposed to all possible solutions.


Any ideas on how to fix?


Hey Bill -


Wondering if you could help me solve my problem, I am doing something very similar to this , however I have multiple return values for a given search value.


EX) Zip code 10001 exist in a few different cells in my search range, and when I run my function it only diplays one value apposed to all possible solutions.


Any ideas on how to fix?



Sorry Britt, I need a lot more information to be able to help. What is “this”. The thread has many things mentioned.


This is awesome and what I am looking for! I have a question... I want to use the second half of the video when you create a linked record referencing the ID. It works perfect if there is a singular match in the lookup table, but what if I have two records that i need to link?

Example: lookup table 'People' contains their company affiliation, email, and if they are the point of contact for that company. I have an Invoices table where I will use your script to match them to their company affiliation and return People ID to the linked column in Invoices. The issue is that I may have more than one person that is the point of contact. How can I adjust the loop and ADD to that linked column in Invoices and not just replace the first one?

Thanks in advance. This script is the bomb!

 


Reply