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

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
=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,918
Messages
6,122,241
Members
449,075
Latest member
staticfluids

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