Sumproduct only visible rows

Jagat Pavasia

Active Member
Joined
Mar 9, 2015
Messages
406
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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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