1

I have the following formula:

SUMPRODUCT((Chart!$J$2:$BE$1000=H$2)*(Chart!$A$2:$A$1000=$A3)*(Chart!$C$2:$C$1000="FE")*(Chart!$H$2:$H$1000="YES")*(Chart!$G$2:$G$1000))

In which:

  • (Chart!$J$2:$BE$1000=H$2): Looks for a specific month in a range of columns.
  • (Chart!$A$2:$A$1000=$A3): Looks for a specific monicker for clients in one column.
  • (Chart!$C$2:$C$1000="FE"): Looks for a specific monicker for transactions in one column.
  • (Chart!$H$2:$H$1000="YES"): Looks for transactions that are going to be renewed, in one column.
  • (Chart!$G$2:$G$1000): These are the ammounts to be summed.

The formula works rather well, but I need to be able to sum a range of columns, not just G2:G1000. Instead of G2:G1000 I need to sum values in the column range $J$2:$EBE$1000, in columns that in their header have a specific name (namely MONTHLY_VOLUME).

I've tried these two formulae:

SUMPRODUCT((Chart!$J$2:$BE$1000=H$2)*(Chart!$A$2:$A$1000=$A3)*(Chart!$C$2:$C$1000="FE")*(Chart!$H$2:$H$1000="YES")*SUMIF(Chart!$J$1:$BE$1," * MONTHLY_VOLUME * ",Chart!$J$2:$BE$1000))

and

SUMPRODUCT((Chart!$J$2:$BE$1000=H$2)*(Chart!$A$2:$A$1000=$A3)*(Chart!$C$2:$C$1000="FE")*(Chart!$HD$2:$H$1000="YES")*INDEX(Chart!$J$2:$BE$1000,,MATCH(" * MONTHLY_VOLUME * ",Chart!$J$1:$BE$1,0)))

Both formulae give me the same results, but the results are wrong. The values are far too high, and I'm guessing it happens because the last part of both formuale, be it the SUMIF or the INDEX lack some parameter to make it so that they work with the previous criteria, rather than just grabbing everything.

So, is this actually doable? If it is, how can I change these formulae to make it work?

Here's the worksheet: https://drive.google.com/file/d/1cMZaKJIMam7NZOr-6LL8OdLwXJTZ2bco/view?usp=sharing

4
  • 1
    @Dante Saint-Germain ,, please edit your post and share some sample data,, help us to fix it ! Commented Nov 21, 2020 at 6:06
  • @Rajesh S Hi, I added a link to Google Drive with the data. Thanks! Commented Nov 21, 2020 at 20:20
  • @DanteSaint-Germain,,,after examine the attached file,, I'm clueless,, since column J to AN other than numbers had Text and Date value,,, truly I'm unable to understand the motive !! considering this Chart!$J$2:$BE$1000=H$2 if H2 is Yes,, then what is the use of Chart!$H$2:$H$1000="YES" ?? Commented Nov 22, 2020 at 8:50
  • @Rajesh S The H$2 in Chart!$J$2:$BE$1000=H$2 refers to the H2 cell in the "FE RENEWAL" tab, that has OCTOBER 2020 as value. The purpose of that part is to find all operations getting renewed in October 2020. On the other hand the purpose of Chart!$H$2:$H$1000="YES"is to find all the operations that will get renewed. Right now all of them say "YES", but next week I'll be having meeting with the salespeople to see which ones will get renewed and which ones won't, so starting next week some of them will say "NO". Commented Nov 22, 2020 at 19:17

1 Answer 1

0

So in the first part of your problem (which you solved already) you generated a mask column vector e.g. (0, 0, 1, 0, 1) which you multiplied cell-by-cell with the amounts column vector e.g. (10, 20, 30, 40, 50) and then used sumproduct to add up the vector elements (= 80 in this example).

Two expand your problem, you now want to identify one or more monthly_volume (MV) columns and add those together based on the mask vector above. e.g. SUMPRODUCT((0, 0, 1, 0, 1) * ((10, 20, 30, 40, 50) + (60, 70, 80, 90, 100))) = 260

Lets use some matrix multiplication. Lets say you have n rows of data and m columns that contain 1 or more MV columns. First get a column vector mask for your MV columns: ([1 x m]' = [m x 1])

TRANSPOSE((Chart!$J$1:$BE$1 = " * MONTHLY_VOLUME * ")*1)

And matrix multiply that by your data matrix to get a single column vector of summed MV columns ([n x m] * [m x 1] = [n x 1])

MMULTI(IFERROR(VALUE($J$2:$EBE$1000),0), TRANSPOSE((Chart!$J$1:$BE$1 = " * MONTHLY_VOLUME * ")*1)

Now use that in your original formula:

SUMPRODUCT((Chart!$J$2:$BE$1000=H$2)*(Chart!$A$2:$A$1000=$A3)*(Chart!$C$2:$C$1000="FE")*(Chart!$H$2:$H$1000="YES")*(MMULTI(IFERROR(VALUE($J$2:$EBE$1000),0), TRANSPOSE((Chart!$J$1:$BE$1 = " * MONTHLY_VOLUME * ")*1)))

Remember to enter the formula with CTRL+SHIFT+ENTER (as an array formula)

4
  • Thank you, but I'm getting a Value Error. I'm noticing that this part (Chart!$J$1:$BE$1 = "*MONTHLY_VOLUME*") returns all FALSE values for some reason. Formulas like SUMIF or MATCH manage to match things, but otherwise it seems not to be working. I tried using an exact match "MONTHLY_VOLUME_R0" to see if the formula worked, and whilst it did return a single TRUE value, the result of the whole formula remained a Value Error. Commented Nov 22, 2020 at 18:45
  • Oh my bad. TRANSPOSE needs to be told its an array formula. Finish the formula with CTRL-SHIFT-ENTER instead of just pressing ENTER Commented Nov 22, 2020 at 19:59
  • Thank you, I tried that too, but it still returns a Value Error. I uploaded the worksheet if that formula here link Commented Nov 22, 2020 at 20:16
  • So the problem seems to be that $J$2:$EBE$1000 also contains text, and MMULTI cannot multiply with text. Try putting any data table that also has text values inside the following IFERROR(VALUE( $J$2:$EBE$1000) -> Also don't forget to CTRL+SHIFT+ENTER Commented Nov 22, 2020 at 22:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .