2-dimensional SUMPRODUCT - Average of all applicable columns - and ignore BLANK rows/cells

jake9951

New Member
Joined
Sep 20, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I try to create a SUMPRODUCT function that averages the seasonality for different accounts over multiple years.

Example of my source data (Input_Sheet):
Account_Number201701201702... (over multiple years - in the format of "YYYYMM")
1001120.3%115.2%... (in percent) - some cells/rows are empty
100298.2%104.3%... (in percent) - some cells/rows are empty
... hundreds of accounts... (in percent) - some cells/rows are empty... (in percent) - some cells/rows are empty... (in percent) - some cells/rows are empty

Example of how the output should look like (Output_Sheet):
Account_Number0102... (the 12 months in the format of "MM" - 01 for January, 02 for February, ...)
1001Average Percentage for "1001" in January (over a period of multiple years)Average Percentage for "1001" in February (over a period of multiple years)... (in percent)
1002Average Percentage for "1002" in January (over a period of multiple years)Average Percentage for "1002" in February (over a period of multiple years)... (in percent)
... hundreds of accounts (exactly the same as above)... (in percent)... (in percent)... (in percent)

For now, I am only trying to make the sum that is already not working, and afterward, I would have tried to make the average out of it.

This is the formula for the first value in the output table in the upper left corner:
Excel Formula:
=SUMPRODUCT(Input_Sheet!$I$3:$AF$780 * (NUMBERVALUE(RIGHT(Input_Sheet!$I$2:$AF$2;2))=!$I$2) * (Input_Sheet!$H$3:$AF$780=$H$3))

Nevertheless, I am always getting #VALUE! errors, which is most likely because some rows/cells have in the source data only empty values.

If you also know how to create averages per month and account, I would appreciate it very much!

Thank you already in advance.

Best regards,
Jake
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Mr Excel Playground 3.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZAAAB
1Account Number201701201702201703201704201705201706201707201708201709201710201711201712201801201802201803201804201805201806201807201808201809201810201811201812201901201902201903
21001122%94%129%121%136%95%51%138%90%111%124%53%56%145%112%140%88%123%79%56%86%61%110%51%130%93%84%
31002134%86%123%139%77%72%98%133%118%90%98%89%58%103%108%145%147%141%53%73%147%145%94%58%56%104%108%
4100397%146%122%86%84%117%145%129%120%77%87%146%68%131%70%78%55%141%53%66%129%144%128%98%115%146%119%
5100481%141%95%140%95%99%59%94%54%142%101%135%104%122%59%51%78%78%99%147%78%101%139%70%119%87%60%
6100569%70%119%85%65%126%77%58%109%115%140%57%53%114%62%57%69%85%107%91%75%73%96%63%72%128%80%
7
8010203040506070809101112
9Account NumberJanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember
10100198%117%108%122%92%105%90%107%117%105%107%79%
11100286%105%97%135%103%103%102%102%134%104%114%78%
12100392%132%114%98%79%116%111%90%104%111%107%115%
131004101%100%69%87%111%91%84%118%79%114%109%111%
14100581%90%79%88%89%112%91%89%94%109%92%63%
15
Sheet32
Cell Formulas
RangeFormula
C1:AB1C1=EOMONTH(B1,0)+1
B10:M14B10=AVERAGE(INDEX($B$2:$XFD$6,MATCH($A10,$A$2:$A$6,0),SEQUENCE(100,1,B$8,12)))
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,022
Members
448,939
Latest member
Leon Leenders

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