Aug 06 2024 10:21 AM
We have several contacts within a company and only 1 primary contact for that company. How do I pull records if the Primary Contact name matches the Firstname and Lastname columns? For example, Joe smith in Primary Contact column matches First Name (Joe) and Last Name (Smith) and it would only pull the one row for Joe. Below is my example:
Compary | Primary Contact | First Name | Last Name |
ABC | Joe Smith | Ann | Full |
ABC | Joe Smith | Karen | Test |
ABC | Joe Smith | Joe | Smith |
ABC | Joe Smith | Jim | Albert |
XYZ | Andy Power | Andy | Power |
XYZ | Andy Power | Sue | Andrew |
Aug 06 2024 11:04 AM - edited Aug 06 2024 11:06 AM
You can use FILTER to do this:
=LET(
check, Sample[First Name] & " " & Sample[Last Name] = Sample[Primary Contact],
FILTER(Sample, check)
)
Aug 06 2024 11:36 AM
Aug 06 2024 12:00 PM
Aug 06 2024 12:37 PM
Aug 06 2024 01:36 PM
Aug 06 2024 02:06 PM
Aug 06 2024 02:27 PM
Aug 06 2024 03:04 PM - edited Aug 06 2024 03:06 PM
The formula uses structured references:
=LET(
check, Sample[First Name] & " " & Sample[Last Name] = Sample[Primary Contact],
FILTER(Sample, check)
)
Sample is the name of the table. To refer to a column in a table, the syntax is TableName[Name of Column].
If you don't have a table in your sheet, you can use explicit references to the ranges (e.g. A2:A10).
This is what the formula looks like without a table:
=LET(
check, Sheet1!$G$2:$G$7 & " " & Sheet1!$H$2:$H$7 =
Sheet1!$F$2:$F$7,
FILTER(Sheet1!$E$2:$H$7, check)
)
Aug 12 2024 07:18 AM
Aug 12 2024 08:28 AM