Excel Subtotal if adjacent column is not blank

Posted by Head of Catering on Super User See other posts from Super User or by Head of Catering
Published on 2012-06-19T14:39:13Z Indexed on 2012/06/19 15:18 UTC
Read the original article Hit count: 191

I'm trying to create a subtotal for a range that excludes rows that don't have a wholesale price. I have a range of products, prices and units that have subtotals by brand, although the brand subtotal is a sum and not a subtotal because the total needs to be displayed regardless of what the user chooses to filter. These subtotal rows do not have wholesale prices.

Here is the sumif formula I'm using to calculate totals in the summary area above the range:

=SUMIF(B5:B12, "", D5:D12)

I need to have a subtotal formula that works the same way. Is there an equivalent to the sumif formula for subtotals? Or maybe a worksheet function I can use?

I need to be able to do this without using VBA.

Incorrect Subtotals

© Super User or respective owner

Related posts about microsoft-excel

Related posts about worksheet-function