admin管理员组

文章数量:1400776

I'm working with two Google Sheets:

Club Registers Sheet:

Contains columns for First Name, Last Name, Club Name, and day identifiers (e.g., Monday, Tuesday, etc.).

A person's name can appear multiple times if they are registered for multiple clubs.

Summary Sheet:

Contains a unique list of all people (by First and Last Name).

I need to populate this sheet with all the clubs that each person attends (e.g., Alex has Football on Monday, Baseball on Tuesday, Colouring on Thursday).

Problem: When trying to match the names between the two sheets, my current approach overwrites the cell's previous data when a new match is found. Instead, I want to append each new club entry to the existing data (either by placing them in the same cell with a separator or in separate cells).

I attempted using functions like Filter or INDEX, but they always return the last result they find.

I'm working with two Google Sheets:

Club Registers Sheet:

Contains columns for First Name, Last Name, Club Name, and day identifiers (e.g., Monday, Tuesday, etc.).

A person's name can appear multiple times if they are registered for multiple clubs.

Summary Sheet:

Contains a unique list of all people (by First and Last Name).

I need to populate this sheet with all the clubs that each person attends (e.g., Alex has Football on Monday, Baseball on Tuesday, Colouring on Thursday).

Problem: When trying to match the names between the two sheets, my current approach overwrites the cell's previous data when a new match is found. Instead, I want to append each new club entry to the existing data (either by placing them in the same cell with a separator or in separate cells).

I attempted using functions like Filter or INDEX, but they always return the last result they find.

Share Improve this question edited Mar 25 at 13:37 Mayukh Bhattacharya 27.8k9 gold badges29 silver badges42 bronze badges asked Mar 25 at 9:30 Sikai ZhangSikai Zhang 11 bronze badge 1
  • I see that you are a fairly new user here at StackOverflow. Please do read how to ask first before asking another question as your post might be closed if it doesn't meet the criteria of it being a good question. Enjoy your stay at StackOverflow. Also, please provide a minimal reproducible example like markdown tables containing your sample input data. – Babanana Commented Mar 25 at 10:14
Add a comment  | 

1 Answer 1

Reset to default 1

Matching Unique Names to a Dataset

I suggest using filter function this way the data provided will be everything that matches the names.

Sample Formula

=LET(names, BYROW('Club Registers Sheet:'!A2:B, LAMBDA(r, JOIN(" ", r))), dataset, HSTACK(names,'Club Registers Sheet:'!C2:D), unqnames, UNIQUE(names), HSTACK(unqnames,BYROW(unqnames, LAMBDA(z, TOROW(FILTER(CHOOSECOLS(dataset,2,3), CHOOSECOLS(dataset,1) = z))))))

The created sample formula is based on the markdown table I created to test it please adjust it accordingly to your need.

Sample Output and Data

It is not clear what your expected output's format is so I opted in on one of your acceptable formats which is divided to each sell or separated by cells.

Club Registers Sheet

First Name Last Name Club Name Day
Rick Grimes Soccer Monday
Sasha Tyresse Archery Monday
Maggie Ri Debate Team Monday
Rick Grimes Debate Team Tuesday
Sasha Tyresse Archery Tuesday
Maggie Ri Soccer Tuesday
Maggie Ri Table Tennis Tuesday

Summary Sheet (Formula Result)

Rick Grimes Soccer Monday Debate Team Tuesday
Sasha Tyresse Archery Monday Archery Tuesday
Maggie Ri Debate Team Monday Soccer Tuesday Table Tennis Tuesday

References:

Filter Function

本文标签: