This is a classic Excel challenge that can be solved very efficiently using lookup functions. The key is to look up based on two criteria: the participant's name (or ID) and the task number.
I'll provide solutions for both modern Excel (Microsoft 365, Excel 2019+) using XLOOKUP (which is much simpler) and older Excel versions using INDEX and MATCH (an array formula).
Recommended Setup: Use Excel Tables!
Before we dive into formulas, I highly recommend converting your data ranges into Excel Tables. This makes formulas much easier to read, automatically adjusts ranges when you add data, and prevents common errors.
To convert to a Table:
- Click anywhere in your data range.
- Go to
Insert tab > Table (or press Ctrl + T).
- Make sure "My table has headers" is checked.
- Name your tables (e.g.,
ParticipantsTable, SubmissionsTable) from the Table Design tab > Table Name.
Scenario Details & Example Structure:
Let's assume your sheets and column headers look something like this:
1. Submissions Table (Sheet Name: SubmissionsData)
(Let's call this table SubmissionsTable)
| Participant Name | Task Number | Completion Time | Points Earned |
|---|
| Alice | 1 | 0:05:12 | 100 |
| Bob | 1 | 0:06:30 | 90 |
| Alice | 2 | 0:10:05 | 95 |
| Charlie | 1 | 0:07:00 | 85 |
| Bob | 2 | 0:09:15 | 100 |
| Alice | 3 | 0:12:30 | 88 |
| ... | ... | ... | ... |
2. Participants Table (Sheet Name: ParticipantsData)
(Let's call this table ParticipantsTable)
| Participant Name | Task 1 | Points 1 | Task 2 | Points 2 | ... | Task 11 | Points 11 |
|---|
| Alice | | | | | | | |
| Bob | | | | | | | |
| Charlie | | | | | | | |
| ... | | | | | | | |
Solution 1: For Modern Excel (Microsoft 365, Excel 2019+, Web) using XLOOKUP
This is the cleanest and most robust method.
The trick here is to combine the Participant Name and Task Number into a single lookup string in both the lookup value and the lookup array.
Formula for Task 1 Completion Time (in cell B2 of ParticipantsData sheet, assuming "Participant Name" is in A1, "Task 1" in B1):
=XLOOKUP(
$A2 & VALUE(MID(B$1, FIND(" ", B$1)+1, 99)),
SubmissionsTable[Participant Name] & SubmissionsTable[Task Number],
SubmissionsTable[Completion Time],
""
)
Let's break down this formula:
$A2: This refers to the Participant Name in the current row of your Participants table. The $ before A locks the column, so when you drag the formula right, it always looks at column A.
VALUE(MID(B$1, FIND(" ", B$1)+1, 99)): This is a clever way to extract the task number from your header like "Task 1".
FIND(" ", B$1): Finds the position of the first space in the header (e.g., in "Task 1", it finds the space after "Task").
+1: Moves one position past the space, to the beginning of the number.
MID(B$1, ..., 99): Extracts characters from that position for up to 99 characters (more than enough for a task number).
VALUE(...): Converts the extracted text (e.g., "1") into a number.
- The
$ before 1 in B$1 locks the row, so when you drag the formula down, it always looks at the header row.
$A2 & VALUE(MID(B$1, FIND(" ", B$1)+1, 99)): This concatenates the participant's name and the extracted task number (e.g., "Alice1", "Bob2"). This combined string is what XLOOKUP will search for.
SubmissionsTable[Participant Name] & SubmissionsTable[Task Number]: This creates an array of combined strings (e.g., "Alice1", "Bob1", "Alice2") from your Submissions table. This is the lookup_array where XLOOKUP will search for a match.
SubmissionsTable[Completion Time]: This is the return_array. If a match is found, XLOOKUP returns the corresponding value from this column.
"": This is the if_not_found argument. If XLOOKUP doesn't find a match (e.g., Alice hasn't submitted Task 5), it will return an empty string instead of an error (#N/A!). You could put 0 or "Not Submitted" here instead.
Formula for Points 1 (in cell C2 of ParticipantsData sheet, assuming "Points 1" in C1):
This formula is very similar, just change the return_array to SubmissionsTable[Points Earned]. You'll also need to adjust the MID function to extract the task number from the "Points X" header.
=XLOOKUP(
$A2 & VALUE(MID(C$1, FIND(" ", C$1)+1, 99)),
SubmissionsTable[Participant Name] & SubmissionsTable[Task Number],
SubmissionsTable[Points Earned],
""
)
- Notice
C$1 instead of B$1 because you're pulling the task number from the Points 1 header.
How to Apply the Formulas:
- Enter the
Task 1 formula into cell B2 of your ParticipantsData sheet.
- Press
Enter.
- Click on cell
B2 again.
- Drag the fill handle (the small square at the bottom right of the cell) horizontally across all "Task X" columns (B2, D2, F2, etc.) until
Task 11.
- With the
Task 1 formula (and now Task 2, Task 3, etc.) cells still selected, drag the fill handle down to apply the formula to all participants.
- Repeat steps 1-5 for the
Points 1 formula, starting in cell C2 and dragging across all "Points X" columns, then down.
Solution 2: For Older Excel (Excel 2016 and earlier) using INDEX and MATCH (Array Formula)
This method is also very powerful but requires an extra step to enter the formula as an array formula.
Formula for Task 1 Completion Time (in cell B2 of ParticipantsData sheet):
=IFNA(
INDEX(
SubmissionsTable[Completion Time],
MATCH(
$A2 & VALUE(MID(B$1, FIND(" ", B$1)+1, 99)),
SubmissionsTable[Participant Name] & SubmissionsTable[Task Number],
0
)
),
""
)
After typing this formula, you MUST press Ctrl + Shift + Enter to enter it as an array formula. Excel will automatically add curly braces {} around the formula in the formula bar. Do NOT type these manually.
Let's break down this formula:
MATCH($A2 & VALUE(MID(B$1, FIND(" ", B$1)+1, 99)), SubmissionsTable[Participant Name] & SubmissionsTable[Task Number], 0):
- This part is similar to the
XLOOKUP's lookup_value and lookup_array. It creates the combined lookup string (e.g., "Alice1") and searches for it within the combined arrays from SubmissionsTable.
0: Specifies an exact match.
- This
MATCH function returns the row number within the SubmissionsTable where the combined participant/task is found.
INDEX(SubmissionsTable[Completion Time], ...):
INDEX takes a range (here, the Completion Time column) and a row number. It then returns the value at that specific row within the range.
IFNA(..., ""): This handles errors. If MATCH doesn't find a match (resulting in #N/A!), IFNA catches this error and returns an empty string ("") instead.
Formula for Points 1 (in cell C2 of ParticipantsData sheet):
=IFNA(
INDEX(
SubmissionsTable[Points Earned],
MATCH(
$A2 & VALUE(MID(C$1, FIND(" ", C$1)+1, 99)),
SubmissionsTable[Participant Name] & SubmissionsTable[Task Number],
0
)
),
""
)
- Remember to press
Ctrl + Shift + Enter after typing this formula as well.
Key Considerations:
- Consistency: Ensure participant names (or IDs) are identical in both tables. Even a space or typo will prevent a match.
- Task Number Format: Make sure "Task Number" in the
Submissions table is truly a number (1, 2, 3...) and not text ("Task 1"). The VALUE() function in the Participants table formula helps convert the header text to a number for matching.
- Performance (for very large datasets): For extremely large tables (tens of thousands of rows or more), array formulas can sometimes be slow.
XLOOKUP is generally more efficient. If you encounter slowness, consider alternative strategies like Power Query or a macro. However, for typical datasets, these formulas will work perfectly fine.
Choose the solution based on your Excel version, and you'll have your tables synced automatically!