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: 4

Some videos you may like

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

hnsd24_CN

Board Regular
Joined
Oct 13, 2020
Messages
78
Office Version
  1. 2016
Platform
  1. Windows
like this?
test.xlsm
ABCDE
1col1col2
2yes1110
3no22
4yes33
5no44
Sheet2
Cell Formulas
RangeFormula
E2E2=SUMPRODUCT(B2:B5*C2:C5*(A2:A5="yes"))
 

DonVito

New Member
Joined
Oct 25, 2020
Messages
3
Office Version
  1. 365
Platform
  1. MacOS
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.
 

hnsd24_CN

Board Regular
Joined
Oct 13, 2020
Messages
78
Office Version
  1. 2016
Platform
  1. Windows
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"))
 

DonVito

New Member
Joined
Oct 25, 2020
Messages
3
Office Version
  1. 365
Platform
  1. MacOS
It works perfectly! Thank you a lot!
Anyway, is there an easier way to do it?
 

Watch MrExcel Video

Forum statistics

Threads
1,123,426
Messages
5,601,585
Members
414,460
Latest member
uctc

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
Top