First off, this is my first time posting, so sorry if I'm missing any important guidelines or formatting! I've been working on a small tool at work that I'm trying to make as turnkey as possible. I'm attempting to use the SUMPRODUCT function to parse my data by two separate custom lists I've created. As with custom lists, the "total" option has to be written manually into the formula, which I was able to achieve with just one custom list. Adding the second one is a little more difficult, as the formula keeps returning 0. The logic I want this formula to follow is to just return the total for the data being pulled if both lists = "total." I'm also trying to make this formula dynamic in the sense that if one of the drop downs = "total," one can still parse out the data further with the other drop down. Any and all help is appreciated on where I am going wrong! My hunch is that I may need one more IF statement, but I'm unsure. Thank you all in advance!
The formula that works is as follows:
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">=IF($B$1="Total",SUMPRODUCT(--('Gap Analysis data
Pull'!$J$2:$J$362=Matrix!$B$2)*--('Gap Analysis data
Pull'!$D$2:$D$362>Matrix!$A6)*--('Gap Analysis data
Pull'!$D$2:$D$362<=Matrix!$B6)*--('Gap Analysis data
Pull'!$D$2:$D$362<>""))/SUMPRODUCT(--('Gap Analysis data
Pull'!$A$2:$A$362<>"")*--('Gap Analysis data
Pull'!$D$2:$D$362<>"")),SUMPRODUCT(--('Gap Analysis data
Pull'!$J$2:$J$362=Matrix!$B$2)*--('Gap Analysis data
Pull'!$I$2:$I$362=Matrix!$B$1)*--('Gap Analysis data
Pull'!$D$2:$D$362>Matrix!$A6)*--('Gap Analysis data
Pull'!$D$2:$D$362<=Matrix!$B6)*--('Gap Analysis data
Pull'!$D$2:$D$362<>""))/SUMPRODUCT(--('Gap Analysis data
Pull'!$A$2:$A$362<>"")*--('Gap Analysis data Pull'!$D$2:$D$362<>"")))
</code>I've attempted to next another IF statement into this formula, which looks like this:
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">=IF($B$1="Total",SUMPRODUCT(--('Gap Analysis data
Pull'!$J$2:$J$362=Matrix!$B$2)*--('Gap Analysis data
Pull'!$D$2:$D$362>Matrix!$A5)*--('Gap Analysis data
Pull'!$D$2:$D$362<=Matrix!$B5)*--('Gap Analysis data
Pull'!$D$2:$D$362<>""))/SUMPRODUCT(--('Gap Analysis data
Pull'!$A$2:$A$362<>"")*--('Gap Analysis data
Pull'!$D$2:$D$362<>"")),IF($B$2="TOTAL",SUMPRODUCT(--('Gap Analysis data
Pull'!$J$2:$J$362=Matrix!$B$2)*--('Gap Analysis data
Pull'!$D$2:$D$362>Matrix!$A5)*--('Gap Analysis data
Pull'!$D$2:$D$362<=Matrix!$B5)*--('Gap Analysis data
Pull'!$D$2:$D$362<>""))/SUMPRODUCT(--('Gap Analysis data
Pull'!$A$2:$A$362<>"")*--('Gap Analysis data
Pull'!$D$2:$D$362<>"")),SUMPRODUCT(--('Gap Analysis data
Pull'!$J$2:$J$362=Matrix!$B$2)*--('Gap Analysis data
Pull'!$I$2:$I$362=Matrix!$B$1)*--('Gap Analysis data
Pull'!$D$2:$D$362>Matrix!$A5)*--('Gap Analysis data
Pull'!$D$2:$D$362<=Matrix!$B5)*--('Gap Analysis data
Pull'!$D$2:$D$362<>""))/SUMPRODUCT(--('Gap Analysis data
Pull'!$A$2:$A$362<>"")*--('Gap Analysis data Pull'!$D$2:$D$362<>""))))</code>
The formula that works is as follows:
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">=IF($B$1="Total",SUMPRODUCT(--('Gap Analysis data
Pull'!$J$2:$J$362=Matrix!$B$2)*--('Gap Analysis data
Pull'!$D$2:$D$362>Matrix!$A6)*--('Gap Analysis data
Pull'!$D$2:$D$362<=Matrix!$B6)*--('Gap Analysis data
Pull'!$D$2:$D$362<>""))/SUMPRODUCT(--('Gap Analysis data
Pull'!$A$2:$A$362<>"")*--('Gap Analysis data
Pull'!$D$2:$D$362<>"")),SUMPRODUCT(--('Gap Analysis data
Pull'!$J$2:$J$362=Matrix!$B$2)*--('Gap Analysis data
Pull'!$I$2:$I$362=Matrix!$B$1)*--('Gap Analysis data
Pull'!$D$2:$D$362>Matrix!$A6)*--('Gap Analysis data
Pull'!$D$2:$D$362<=Matrix!$B6)*--('Gap Analysis data
Pull'!$D$2:$D$362<>""))/SUMPRODUCT(--('Gap Analysis data
Pull'!$A$2:$A$362<>"")*--('Gap Analysis data Pull'!$D$2:$D$362<>"")))
</code>I've attempted to next another IF statement into this formula, which looks like this:
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">=IF($B$1="Total",SUMPRODUCT(--('Gap Analysis data
Pull'!$J$2:$J$362=Matrix!$B$2)*--('Gap Analysis data
Pull'!$D$2:$D$362>Matrix!$A5)*--('Gap Analysis data
Pull'!$D$2:$D$362<=Matrix!$B5)*--('Gap Analysis data
Pull'!$D$2:$D$362<>""))/SUMPRODUCT(--('Gap Analysis data
Pull'!$A$2:$A$362<>"")*--('Gap Analysis data
Pull'!$D$2:$D$362<>"")),IF($B$2="TOTAL",SUMPRODUCT(--('Gap Analysis data
Pull'!$J$2:$J$362=Matrix!$B$2)*--('Gap Analysis data
Pull'!$D$2:$D$362>Matrix!$A5)*--('Gap Analysis data
Pull'!$D$2:$D$362<=Matrix!$B5)*--('Gap Analysis data
Pull'!$D$2:$D$362<>""))/SUMPRODUCT(--('Gap Analysis data
Pull'!$A$2:$A$362<>"")*--('Gap Analysis data
Pull'!$D$2:$D$362<>"")),SUMPRODUCT(--('Gap Analysis data
Pull'!$J$2:$J$362=Matrix!$B$2)*--('Gap Analysis data
Pull'!$I$2:$I$362=Matrix!$B$1)*--('Gap Analysis data
Pull'!$D$2:$D$362>Matrix!$A5)*--('Gap Analysis data
Pull'!$D$2:$D$362<=Matrix!$B5)*--('Gap Analysis data
Pull'!$D$2:$D$362<>""))/SUMPRODUCT(--('Gap Analysis data
Pull'!$A$2:$A$362<>"")*--('Gap Analysis data Pull'!$D$2:$D$362<>""))))</code>