Thanks for the details! You basically want to merge (join) your two sheets based on common columns (domain or linkedid), and get, for each company, a row that also lists all three employees related to that company.
Since you have an older version of Excel, Power Query is not available, so we will do this with formulas — specifically lookup formulas — and some structuring.
Scenario Recap
-
Sheet1: Company info with columns:
Company Name | Domain | Linked ID | Location
(One row per company)
-
Sheet2: Employee info with columns:
Employee Name | LinkedID | Domain
(3 employees per company, so 3 rows per domain/company)
-
Goal:
Combine into one sheet that lists:
Company Name | Domain | Linked ID | Location | Employee1 | Employee2 | Employee3
Step-by-step solution (using formulas):
Step 1: Make sure data is formatted as Tables (optional but easier)
- Select each data range and press Ctrl + T → Create two tables:
For example: tblCompanies (Sheet1) and tblEmployees (Sheet2)
Step 2: Setup your merged sheet (can be a copy of Sheet1)
Let's say you create a new sheet — call it Merged.
-
Copy the entire company table from Sheet1 to Merged sheet (columns: Company Name, Domain, Linked ID, Location)
-
Add 3 new columns to the right: Employee 1, Employee 2, Employee 3
Step 3: Return the Employee Names for each company
Because each company’s domain has 3 employees in Sheet2, we want to pull each employee’s name matching the domain.
Assuming:
-
Merged!B2 contains the domain for the current company
-
Sheet2 employee data is in Sheet2!A:C with Employee Name in column A, and Domain in column C
Step 4: Formula to get multiple matches (nth match)
Excel doesn't have a built-in function like INDEX with a criteria and nth occurrence easily, but we can do it using an array formula with SMALL + IF.
Suppose:
-
Company domain is in Merged!B2
-
Employees domain column is Sheet2!$C$2:$C$100
-
Employee name column is Sheet2!$A$2:$A$100
To get the first employee matching the domain:
=IFERROR(
INDEX(Sheet2!$A$2:$A$100,
SMALL(
IF(Sheet2!$C$2:$C$100 = $B2,
ROW(Sheet2!$C$2:$C$100) - ROW(Sheet2!$C$2) + 1),
1)
),
"")
To get the second employee, change the last argument of SMALL from 1 to 2.
For the third employee, use 3.
How to enter the formula:
-
The formula is an array formula in Excel versions prior to 365 — so after typing the formula, press Ctrl + Shift + Enter instead of just Enter. You’ll see curly braces {} around the formula automatically.
-
In Excel 365 or 2021, just Enter works as Excel has dynamic arrays.
Example:
In Merged!E2 ("Employee 1") put:
=IFERROR(
INDEX(Sheet2!$A$2:$A$100,
SMALL(
IF(Sheet2!$C$2:$C$100 = $B2,
ROW(Sheet2!$C$2:$C$100) - ROW(Sheet2!$C$2) + 1),
1)
),
"")
Enter with Ctrl+Shift+Enter (if needed).
In Merged!F2 ("Employee 2"):
=IFERROR(
INDEX(Sheet2!$A$2:$A$100,
SMALL(
IF(Sheet2!$C$2:$C$100 = $B2,
ROW(Sheet2!$C$2:$C$100) - ROW(Sheet2!$C$2) + 1),
2)
),
"")
In Merged!G2 ("Employee 3"):
=IFERROR(
INDEX(Sheet2!$A$2:$A$100,
SMALL(
IF(Sheet2!$C$2:$C$100 = $B2,
ROW(Sheet2!$C$2:$C$100) - ROW(Sheet2!$C$2) + 1),
3)
),
"")
Then copy down these formulas for all companies.
Notes:
-
Make sure ranges in Sheet2 ($A$2:$A$100 and $C$2:$C$100) cover all your employees.
-
Adjust columns if your employee name or domain columns are in different positions.
-
The IFERROR hides errors if there are fewer than 3 employees for a company.
Optional: If you want to join employees in a single cell (comingled)
In newer Excel, you could use TEXTJOIN + FILTER formulas. But in old versions, this is more complicated.
The split columns method (Employee 1, Employee 2, Employee 3) is simpler.
Summary:
| Merged Sheet Columns: | Formula description |
|---|
| Company Info (copied from Sheet1) | Just copied over |
| Employee 1 | Formula extracts 1st employee matching domain |
| Employee 2 | Formula extracts 2nd employee matching domain |
| Employee 3 | Formula extracts 3rd employee matching domain |
If you want, I can prepare an example workbook or share exact formulas adapted to your data ranges.
Let me know if you'd like help with the actual formula or exact steps!