Sumproduct only visible rows

Jagat Pavasia

Active Member
Joined
Mar 9, 2015
Messages
404
Office Version
  1. 2021
Platform
  1. Windows
Dear sir,
I have item name in "A2 to A6".
"B2 to B6" have quantity of items,
"C2 to C6" have cost of items.

I want answer in D1 that if I selected item only " apple' than automatically sum-product visible raw.

I have attach screenshot with 3 example, please help me that which formula for "D1" ?


help
1.JPG
2.JPG
3.JPG
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Try

Excel Formula:
=SUBTOTAL(9,C2:C50)
 
Upvote 0
Try

Excel Formula:
=SUBTOTAL(1,C2:C50)
 
Upvote 0
Add a helper column in D with
Excel Formula:
=SUBTOTAL(103,A2)
and then you can use
Excel Formula:
=SUMPRODUCT(B2:B6,C2:C6,D2:D6)/SUMPRODUCT(B2:B6,D2:D6)
 
Upvote 0
Solution
Add a helper column in D with
Excel Formula:
=SUBTOTAL(103,A2)
and then you can use
Excel Formula:
=SUMPRODUCT(B2:B6,C2:C6,D2:D6)/SUMPRODUCT(B2:B6,D2:D6)
yes, it is working as it should,

but, is it necessary for helper column ? other any idea, sir ?
 
Upvote 0
No it's not necessary, but it's by far the simplest & most efficient way.
 
Upvote 0
Try this formula in D1 without using a helper column :

Excel Formula:
=SUMPRODUCT(--(A1:A6=INDEX(A2:A6,MIN(IF(SUBTOTAL(3,OFFSET(A2,ROW(A2:A6)-ROW(A2),0)),ROW(A2:A6)-ROW(A2)+1)))),B1:B6,C1:C6)/SUMPRODUCT(--(A1:A6=INDEX(A2:A6,MIN(IF(SUBTOTAL(3,OFFSET(A2,ROW(A2:A6)-ROW(A2),0)),ROW(A2:A6)-ROW(A2)+1)))),B1:B6)
 
Upvote 0

Forum statistics

Threads
1,221,470
Messages
6,160,029
Members
451,611
Latest member
PattiButche

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