If you are getting right figures... when there is no filters... then there is no problem in your formula..
The problem is with filter... that to, you have mentioned "the total is inaccurate for some rows/columns"
it is better if you can show us the screen shot..
--Subbu