I have read through the posts on with subtotal and sumif in the forums, but can't get this one working.

I have a workbook that is pulling in data from MSSQL 2005. I am trying to show a total at the end of a column based on if a second column contains a certain value. I can do this with sumif, but when I run filters it doesn't change the totals.

So for instance

G H J
$10.00 DAP 01/01/2005
$10.00 DAP 01/01/2005
$10.00 DAP 02/01/2005
$10.00 JBB 02/01/2005


If I want the total for column 1 where all column H = DAP then I use this:

=SUMIF(H2:H3058,"DAP",G2:G3058)

and I get a total of $30.00, but when I filter add a filter and only pull dates from Jan 01/2005, then it still shows $30.00. I am trying to get it so that when I apply the filter it shows $20.00.

Any help would be greatly appreciated.