Why Does this Sumproduct Formula Give a Different Result to Countifs?

rob51852

Board Regular
Joined
Jun 27, 2016
Messages
191
Office Version
  1. 2016
Platform
  1. Windows
Hi,

Can anyone tell me why the Sumproduct formula returns a different result to the Countifs formula? The Countifs gives the correct result.

Thanks

=SUMPRODUCT((DataTable[Lowest Delta]>=$A8)*(DataTable[Result]="LOSER"))
=COUNTIFS(DataTable[Lowest Delta],">=" &$A8,DataTable[Result],"LOSER")
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi, it would help if you posted some sample data that demonstrated the problem, but it could be that whatever is in A8 is not the same data type as whatever is in the "Lowest Delta" column. i.e. A8 might be text and "Lowest Delta" numeric. COUNTIFS() can be a little more forgiving in situations like this. For example:

Book2
ABCDE
1
2
3
4
5
6
7
81< Text
9
10Lowest DeltaIs NumberResult0
112TRUELOSER3
122TRUELOSER
132TRUELOSER
Sheet1
Cell Formulas
RangeFormula
A8A8="1"
E10E10=SUMPRODUCT((DataTable[Lowest Delta]>=$A8)*(DataTable[Result]="LOSER"))
E11E11=COUNTIFS(DataTable[Lowest Delta],">=" &$A8,DataTable[Result],"LOSER")
B11:B13B11=ISNUMBER([@[Lowest Delta]])
 
Upvote 0
The above is one scenario, another is that the expression used by SumProduct being (DataTable[Lowest Delta]>=$A8) will evaluate anything in "Lowest Delta" that is text as being greater than whatever number you have in A8.
This includes any formulas in that column that return "".
Countifs appears to just ignore any text values in the Criteria_Range ie Lowest Delta.

If the only text values in the column are "" then you could try this:
Rich (BB code):
=SUMPRODUCT((DataTable[Lowest Delta]>=$A8)*(DataTable[Result]="LOSER")*(DataTable[Lowest Delta]<>""))

If you have other text values as well then this should work:
Rich (BB code):
=SUMPRODUCT((DataTable[Lowest Delta]>=$A8)*(DataTable[Result]="LOSER")*ISNUMBER(DataTable[Lowest Delta]))
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,151
Members
453,021
Latest member
Justyna P

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