I have three interrelated google sheet spreadsheets. In the worksheet "Input data" names and different roles are defined.
In the table sheet "Assignment" these specific names are assigned with values: I use the following formula on Location:
=IF(C2<>"", VLOOKUP(C2,'Input Data'!C$3:D$7,2,FALSE),"")
In the table sheet "Evaluation" an evaluation takes place. The problem is that if a name (for example: Green,John) is deleted from "Input Data" but is still in "Assignment", the following error occurs on the "Evaluation" worksheet for this formula:
=ARRAY_CONSTRAIN(ARRAYFORMULA(SUM(IF((IF($B$2="dontcare",1,REGEXMATCH(Assignment!$E$3:$E$577,$B$2 &"*")))*(IF($B$3="dontcare",1,(Assignment!$E$3:$E$577=$B$3)))*(IF($B$4="dontcare",1,(Assignment!$D$3:$D$577=$B$4)))*(IF($B$5="dontcare",1,(Assignment!$F$3:$F$577=$B$5)))*(IF($B$6="dontcare",1,(Assignment!$B$3:$B$577=$B$6))),(Assignment!S$3:S$577)))), 1, 1)
Error: When evaluating VLOOKUP, the value "Green, John" was not found.
Is it possible to avoid this error with a macro that deletes Names from assignment sheet that are not in the Input data sheet? Do you have any ideas for a code? So my only question is, how to write a script that deletes the complete lines in the assignment list, if a line occurs with a name like Green, John, that is not in the input data list. short version: Example! Assignment sheet: line 7 Green, John -> check if Green, John is in sheet Input Data in row C! If Green, John is not in Input Data row C -> delete line 7 Green, John in Assignment! .... That is basically my question!
example sheet with further explanation: https://docs.google.com/spreadsheets/d/1OU_95Lhf6p0ju2TLlz8xmTegHpzTYu4DW0_X57mObBc/edit#gid=1763280488