help update my sumproduct please

BrutalLogiC

Active Member
Joined
Feb 26, 2006
Messages
274
Office Version
  1. 365
Platform
  1. Windows
=SUMPRODUCT((YEAR($D$24:$AN$24)=H2)*($D$25:$AN$36))

trying to adjust above so the full formula is returning the value based on:

1. the year in D24:AN24 being equal to H2; and
2. the criteria in B25:B35 being equal to E3

with the values in the range D25:AN36

help!
 
Last edited:

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
your ranges must be the same length...

Code:
=SUMPRODUCT((YEAR($D$24:$AN$[color=red]36[/color])=H2)*($D$25:$AN$36))
 
Upvote 0
I didn't explain well enough as the original formula works for me but only considers the years (point 1), I am probably trying to edit a formula when I need a completely different one?

D24:AN24 is a list of dates which are between the years 2019 and 2022
B25:B35 is a list of names (John, Mo, Seb etc.)
I'm trying to write formula which returns the sum of the range D25:AN36 where the year is X and the name is Y
 
Upvote 0
I'm trying to compare the row against a year and the column against a name and when the two match in the block of cells I want the result.. now I'm trying to work out how to use the MrExcel HTML maker:)
 
Upvote 0
Not sure if I understand your request as your stated ranges are a little confusing. Is this what you are looking for (adjust for your ranges)?

=SUMPRODUCT((YEAR($D$24:$J$24)=$H$2)*($D$25:$J$36=($B$25:$B$36))*($D$25:$J$36))

Rick
 
Upvote 0
I didn't explain well enough as the original formula works for me but only considers the years (point 1), I am probably trying to edit a formula when I need a completely different one?

D24:AN24 is a list of dates which are between the years 2019 and 2022
B25:B35 is a list of names (John, Mo, Seb etc.)
I'm trying to write formula which returns the sum of the range D25:AN36 where the year is X and the name is Y


Control+shift+enter, not just enter:

=SUM(IF(D24:AN24=2020,IF(B25:B36="Mo",D25:AN36)))
 
Upvote 0
Not sure if I understand your request as your stated ranges are a little confusing. Is this what you are looking for (adjust for your ranges)?

=SUMPRODUCT((YEAR($D$24:$J$24)=$H$2)*($D$25:$J$36=($B$25:$B$36))*($D$25:$J$36))

Rick

Thanks this works for me thanks:
=SUMPRODUCT((YEAR($D$25:$AN$25)=H$3)*($B$26:$B$36=($E4))*($D$26:$AN$36))


Control+shift+enter, not just enter:

=SUM(IF(D24:AN24=2020,IF(B25:B36="Mo",D25:AN36)))

{=SUM(IF($D$25:$AN$25=H$3,IF($B$26:$B$36=$E4,$D$26:$AN$36)))} thanks, I'm trying this but no result

I think it's because D25:AN25 is in format mmm-yy and H3 is just a number 2019 so can't read it properly?
 
Upvote 0
Thanks this works for me thanks:
=SUMPRODUCT((YEAR($D$25:$AN$25)=H$3)*($B$26:$B$36=($E4))*($D$26:$AN$36))




{=SUM(IF($D$25:$AN$25=H$3,IF($B$26:$B$36=$E4,$D$26:$AN$36)))} thanks, I'm trying this but no result

I think it's because D25:AN25 is in format mmm-yy and H3 is just a number 2019 so can't read it properly?


Control+shift+enter, not just enter:

=SUM(IF(YEAR($D$25:$AN$25)=H$3,IF($B$26:$B$36=$E4,$D$26:$AN$36)))
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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