Google Sheets formula working in only some cells

I’m using a formula to search for a term within a cell and populate the correlating name into a cell on a connected sheet. The sheet1 (form responses) would be populated by data from a form. sheet2 (Saturday and Sunday) is to insert the names into the empty cells so people know those spots are taken and don’t try to select them. But I can’t get it to work anymore and I’m totally lost as to why

It works in some cells but not others. What I have figured out is the person in the first row will populate correctly for the class in the first column after the name field and so on (Name one only works in class 1, Name 2 only works in class 2 etc.)

=IF(ISNUMBER(SEARCH(term,rage of cells in sheet1)), correlating name of that row, )