Jet Fusion
When placing the formula in the spreadsheet you have to check the amount of line, because the formula is specific, note that in this formula ROW ('1'! $ G $ 35: $ BB $ 237) -34 I changed it to 34 because the tab starts at line 35 and also the number of cells is for 237 which is the number of lines you want to answer the formula, this formula also has to change to ROW ($ L $ 16: $ L $ 40) -15 changed to 15, I could fix but you asked for more line, remember, before I put {1; 2; 3; 4}, it is also important to check if the IF function is correct note you left IF (B16 <> ""; this way B16 is always empty because it has to be IF (C16 <> ""; C16 where this is the formula to bring the result.
I hope I explained it well, but if you have more questions you can ask as many times as you need
Decio