Google Sheets – Circular Dependency Detected Error

google sheets

I am very beginner to Google scripting. Here I need to count the number of times the word "FREE" occurred in my sheet. But my function returns me an error

Error: Circular dependency detected**

(See the attached screen shot.)

What am I doing wrong and how can I fix it?

Please note: I have some merged cells here.

enter image description here

Best Answer

This is happening because you have put the formula inside the range (A1:c6) that you are trying to count the number of "free"'s in.

Put the formula into a cell outside the range.