Sumproduct returning value error or blank?

brettthomas

New Member
Joined
Jun 28, 2011
Messages
3
Hello,

I am trying to do what I thought would be extremely simple: Find text in column D, and for each "true", sum it's respective values in column E. In other words, I'm doing a simple =SUMIF(D2:D44,L10,E2:E44), but instead of matching the exact contents of L10, I need it to find the contents of L10 WITHIN column D (ie: find "I am tearing" in "I am tearing my hair out"). I have no idea why the following won't work. It gives a value error if entered normally, or evaluates incorrectly to "0" if entered as an array formula:

=SUMPRODUCT(IF(ISNUMBER(SEARCH(L10,D2:D44)),1,0),E2:E44)

Same thing here:

=SUMPRODUCT(--(ISNUMBER(SEARCH(L10,D2:D44))),E2:E44)

{=IF(ISNUMBER(SEARCH(L10,D2:D65)),1,0)} evaluates correctly to an array {0,0,0,1,0,0,1,1,0,1,0,0,etc}, and E2:E44 is an array, so why can't Sumproduct multiply and sum these arrays? There are currently no blank cells in either column, but it will eventually need to be able to handle (meaning ignore) blank cells. Any ideas???

Thanks in advance!

-Brett
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hello,

I am trying to do what I thought would be extremely simple: Find text in column D, and for each "true", sum it's respective values in column E. In other words, I'm doing a simple =SUMIF(D2:D44,L10,E2:E44), but instead of matching the exact contents of L10, I need it to find the contents of L10 WITHIN column D (ie: find "I am tearing" in "I am tearing my hair out"). I have no idea why the following won't work. It gives a value error if entered normally, or evaluates incorrectly to "0" if entered as an array formula:

=SUMPRODUCT(IF(ISNUMBER(SEARCH(L10,D2:D44)),1,0),E2:E44)

Same thing here:

=SUMPRODUCT(--(ISNUMBER(SEARCH(L10,D2:D44))),E2:E44)

{=IF(ISNUMBER(SEARCH(L10,D2:D65)),1,0)} evaluates correctly to an array {0,0,0,1,0,0,1,1,0,1,0,0,etc}, and E2:E44 is an array, so why can't Sumproduct multiply and sum these arrays? There are currently no blank cells in either column, but it will eventually need to be able to handle (meaning ignore) blank cells. Any ideas???

Thanks in advance!

-Brett
You can use the SUMIF function.

=SUMIF(D2:D44,"*"&L10&"*",E2:E44)

Or, the SUMPRODUCT version:

=SUMPRODUCT(--(ISNUMBER(SEARCH(L10,D2:D44))),E2:E44)
 
Upvote 0
Thanks so much for your help! The Sumproduct version that you gave me is actually the exact equation that I had in my original post, which was not working. I have realized, though, that it was in fact working, but the cell containing the equation will not update when something changes in D2:D44 or E2:E44, so it was stuck evaluating to "0" until I reopened the cell containing the equation, then hit enter again to lock it in after a change was made to one of those ranges. It then reevaluates to the correct number, but I have to do that every time a change is made. . . . not good.

I've never seen this before. Any idea why it won't automatically update when a change is made to cells/arrays within the equation? Strangely enough, your SUMIF version won't automatically update either. I have hundreds of instances of SUMIF in my spreadsheets, and it has always automatically updated until now. Very weird.

Thanks again!

-Brett
 
Upvote 0
Ahhhh!!!! Disregard the last post. I just spent a day and a half pulling my hair out because "Calculate" had somehow been switched to "Manual". I've never even opened that tab in the preferences. Who knows why that happened, but at least it works now. Thanks again for your time and help!
 
Upvote 0
Ahhhh!!!! Disregard the last post. I just spent a day and a half pulling my hair out because "Calculate" had somehow been switched to "Manual". I've never even opened that tab in the preferences. Who knows why that happened, but at least it works now. Thanks again for your time and help!
Hmmm...

For some reason I did not even see your other post until just now. I could have steered you in that direction if I had seen your post.

Glad you got it straightened out, though. Thanks for the feedback! :cool:
 
Upvote 0

Forum statistics

Threads
1,224,540
Messages
6,179,417
Members
452,912
Latest member
alicemil

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