Weird Sumproduct Result

mahmed1

Well-known Member
Joined
Mar 28, 2009
Messages
2,222
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
 

Some videos you may like

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Noodleski

Active Member
Joined
Nov 18, 2015
Messages
467
Blank is a string, asfaik. So how should Excel calculate what is greater than? Did you mean different from blank: <>"" or larger than 0?
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
Try...

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

Noodleski

Active Member
Joined
Nov 18, 2015
Messages
467
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?
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201

ADVERTISEMENT

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.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,400
Messages
5,601,462
Members
414,451
Latest member
jrose7

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
Top