Subtotal with a criteria

Sachin2k6

Active Member
Joined
Mar 3, 2012
Messages
369
Hi All

I have a filtered range like this :


RowNo. ColumnA ColumnB
1 Gold 35
3 Silver 25
8 Silver 28
10 Gold 45

Range can be extended up to 10000 rows. I want the subtotal of the visible cells of the column B when the corresponding cell in columnA contains 'Gold'. How can i get this??

Thanks in advance.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
=SUMPRODUCT(SUBTOTAL(9,OFFSET($B$2:B$10000,ROW($A$2:$A$10000)-MIN(ROW($A$2:$A$10000)),,1)),--($A$2:$A$10000="gold"))
 
Upvote 0
just one more thing ,what is the meaning of '--' in the end portion. If i omit these signs then formula results 0. Why???
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,733
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top