Hi,
First, let me ammend the previous formula: you have to change $A$17 to $A17 ( swith the row reference to relative reference, this will make the formula to autoadjust when copied to another row)
Don't forget to enter the formula with CSE after you make this change.
For the second problem, again, it's a good idea to upload a sample workbook

maybe we can spot other problems.
Another great idea is to share with us the exact error message, just saying that there is an error is not very helpful.
Cheers,
Catalin