How to apply SUMPRODUCT avoiding columns headers

DonVito

New Member
Joined
Oct 25, 2020
Messages
3
Office Version
  1. 365
Platform
  1. MacOS
Hi guys, my first post here and I would like to ask your help for my problem.
I'm trying to use sumproduct, but cant really find a way to avoid errors because of the headers.
In the pic attached, all I want to do is multiply col G and H if there's a "yes" in col F.
Any suggestion?

Thank in advance
 

Attachments

  • 1.png
    1.png
    76.1 KB · Views: 8

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
like this?
test.xlsm
ABCDE
1col1col2
2yes1110
3no22
4yes33
5no44
Sheet2
Cell Formulas
RangeFormula
E2E2=SUMPRODUCT(B2:B5*C2:C5*(A2:A5="yes"))
 
Upvote 0
like this?
test.xlsm
ABCDE
1col1col2
2yes1110
3no22
4yes33
5no44
Sheet2
Cell Formulas
RangeFormula
E2E2=SUMPRODUCT(B2:B5*C2:C5*(A2:A5="yes"))
Yes! exactly! But I would like to generalize and get all columns ( B:B, C:C ... and so on), in order to automatically generate the sumproduct if I update the matrix. But as I do, it gives me error, and I understand it's because of the headers.
 
Upvote 0
If it's a dynamic area, you can use Indirect instead of A:A
test.xlsm
ABCDE
1col1col2
2yes1110
3no22
4yes33
5no44
Sheet2
Cell Formulas
RangeFormula
E2E2=SUMPRODUCT(INDIRECT("B2:B"&COUNTA(B:B))*INDIRECT("C2:C"&COUNTA(B:B))*(INDIRECT("A2:A"&COUNTA(B:B))="yes"))
 
Upvote 0
It works perfectly! Thank you a lot!
Anyway, is there an easier way to do it?
 
Upvote 0

Forum statistics

Threads
1,214,431
Messages
6,119,458
Members
448,899
Latest member
maplemeadows

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