So I have column A for the staff number which matches row number and the number then corresponds to the staff member's name in column B.

So it looks a little like this but with 26 staff members currently:

1 John
2 Jane
3 Steve
4 Allison

Now in another sheet I'll have the day of the week in column A and the employee numbers in column B, but there actually could be more than 4 employees working a certain day. There could be 10, but it looks like so:

Mon 1,2,3
Tue 2,3,4
Wed 1,2,4
Thur 1,3,4
Fri 1,2,3,4
Sat 2,4
Sun 1,3

Then in column C I am trying to write a function that checks each number in column B and displays the corresponding names separated by the commas so the final should look like this:

Mon 1,2,3 John,Jane,Steve
Tue 2,3,4 Jane,Steve,Allison
Wed 1,2,4 John,Jane,Allison
Etc...

I feel like it could be entirely possible, but I am just not good enough at this yet. Thank you in advance for your time on attempting to help me on this, I greatly appreciate it!