I have a SUM that sometimes needs to exclude some cells that are hidden.

How do I do this? There will still be data in the cell - I just dont want it in my = when those cells are hidden.