Weird Sumproduct Result

mahmed1

Well-known Member
Joined
Mar 28, 2009
Messages
2,302
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi

I have this formula

=SUMPRODUCT((--((Sheet1!$A$3:$A$25+0)=DASHBOARD!$A$2))*(--(Sheet1!$B$3:$B$25>"")))

This works fine until...

(--(Sheet1!$B$3:$B$25>"")) - I though this would give me anything that is not blank whether that means text or number as it is greater than blank however it seems to ignore numbers as greater than blank and returns false so if i had 9 this returns false =B4>""

Should this be the case ? and what do i need to add to make sure anything other than blank should return a true?

Thank You
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Blank is a string, asfaik. So how should Excel calculate what is greater than? Did you mean different from blank: <>"" or larger than 0?
 
Upvote 0
Try...

=SUMPRODUCT(--(Sheet1!$A$3:$A$25+0=DASHBOARD!$A$2),1-(Sheet1!$B$3:$B$25=""))
 
Last edited:
Upvote 0
Try...

=SUMPRODUCT(--(Sheet1!$A$3:$A$25+0=DASHBOARD!$A$2),1-(Sheet1!$B$3:$B$25=""))
Hi Aladin, just for my own education:

the 1-(Sheet1!$B$3:$B$25="") part has more or less the same function as (Sheet1!$B$3:$B$25<>"").
Having seen your tendency to go for the faster options, does that mean your solution offers a better performance or is there a functional difference I'm missing?
 
Upvote 0
Hi Aladin, just for my own education:

the 1-(Sheet1!$B$3:$B$25="") part has more or less the same function as (Sheet1!$B$3:$B$25<>"").
Having seen your tendency to go for the faster options, does that mean your solution offers a better performance or is there a functional difference I'm missing?

I did not profile the '1 minus relational test' bit I often use. (I need an updated version of Wiliams's Fast Excel for the older version no longer works, I guess, on newer systems.) Would feel lucky if it was evaluated faster than the expression with a negation test.
 
Upvote 0

Forum statistics

Threads
1,214,940
Messages
6,122,356
Members
449,080
Latest member
Armadillos

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