How to Use the LookUp Function
Let’s break down the steps to use the LookUp function with practical examples. For our examples we will be working off this sample data set
Example 1: Basic Usage
If you have a table named Employees and you want to find the record of an employee with the ID 101, run this function and it will return you the record that matches. If no matches are found then the look up will return blank.
Formula
LookUp(Employees, ID = 101)
Output
Example 2: Using Multiple Condition
You can also use multiple conditions to focus your search. For example, find an employee with the where they belong to IT department and hold the Position of “developer” you would use :
LookUp(Employees, Department = “IT” && Position = “Developer”)
Possible Criteria Matches
As the lookup function only returns the first record that matches the condition, the output would be:
Output
The above can be extend to return a specific value by using the ReductionFormula parameter.
LookUp(Employees, Department = “IT” && Position = “Developer”, Salary)
Will output 68000, the salary associated to this record, which can be used in your application.
Practical Examples
Example use cases for the the LookUp function are:
- Form Validation: Check if a user exists before submitting a form.
- Data Retrieval: Reduce a large dataset to display to a user.
- Conditional Formatting: Apply conditional formatting based on Lookup criteria.