Please help me to understand this 'SUMPRODUCT' formula.

maanalyst

New Member
Joined
May 4, 2022
Messages
2
Hi,

I want to understand this formula
=SUMPRODUCT((AB3<AB$3:AB$31)/COUNTIF(AB$3:AB$31,AB$3:AB$31))+1

Can someone please explain how this formula is working?
 

Excel Facts

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

I want to understand this formula
=SUMPRODUCT((AB3<AB$3:AB$31)/COUNTIF(AB$3:AB$31,AB$3:AB$31))+1

Can someone please explain how this formula is working?
The formula returns the number of values in the range AB3:AB31 that exceed the value of AB3 and then adds 1 to that count. To see how the formula is evaluated go to the ribbon Formulas>Formula Auditing>Evaluate Formula.
I think you can simplify the formula to use only a single worksheet function, like this:
=SUMPRODUCT(--(AB3:AB31>AB3))+1
 
Upvote 0
Solution
The formula returns the number of values in the range AB3:AB31 that exceed the value of AB3 and then adds 1 to that count.
Wouldn't it be a bit more straightforward to do this:

Excel Formula:
=COUNTIF(AB$3:AB$31, ">"& AB3) + 1
 
Upvote 0
The formula returns the number of values in the range AB3:AB31 that exceed the value of AB3 and then adds 1 to that count. To see how the formula is evaluated go to the ribbon Formulas>Formula Auditing>Evaluate Formula.
I think you can simplify the formula to use only a single worksheet function, like this:
=SUMPRODUCT(--(AB3:AB31>AB3))+1
No, I dont think so
this formula to count unique distinct value that greater than AB3, then plus 1
In which:
1/COUNTIF(AB$3:AB$31,AB$3:AB$31) to divide value by how many times it appears: For instant: value 3 appears to 2 times, become 1/2 & 1/2
(AB$3:AB$31>AB3)/COUNTIF(AB$3:AB$31,AB$3:AB$31) to narrow results with condition >AB3
Then
SUMPRODUCT(...) to count
See my below sheet:

Book1
ABACADAE
2Value list1/countif> AB3 conditionresults range
321/3FALSE0
411FALSE0
521/3FALSE0
621/3FALSE0
731/2TRUE1/2
831/2TRUE1/2
941/23TRUE1/23
1041/23TRUE1/23
1141/23TRUE1/23
1241/23TRUE1/23
1341/23TRUE1/23
1441/23TRUE1/23
1541/23TRUE1/23
1641/23TRUE1/23
1741/23TRUE1/23
1841/23TRUE1/23
1941/23TRUE1/23
2041/23TRUE1/23
2141/23TRUE1/23
2241/23TRUE1/23
2341/23TRUE1/23
2441/23TRUE1/23
2541/23TRUE1/23
2641/23TRUE1/23
2741/23TRUE1/23
2841/23TRUE1/23
2941/23TRUE1/23
3041/23TRUE1/23
3141/23TRUE1/23
32
3342
34count unique distinct valuecount unique distinct value that >AB3
35
36plus 13
Sheet1
Cell Formulas
RangeFormula
AC3:AC31AC3=1/COUNTIF($AB$3:$AB$31,AB3)
AD3:AD31AD3=AB3>$AB$3
AE3:AE31AE3=AC3*AD3
AC33,AE33AC33=SUM(AC3:AC31)
AE36AE36=SUMPRODUCT((AB$3:AB$31>AB3)/COUNTIF(AB$3:AB$31,AB$3:AB$31))+1
 
Upvote 0
The formula returns the number of values in the range AB3:AB31 that exceed the value of AB3 and then adds 1 to that count. To see how the formula is evaluated go to the ribbon Formulas>Formula Auditing>Evaluate Formula.
I think you can simplify the formula to use only a single worksheet function, like this:
=SUMPRODUCT(--(AB3:AB31>AB3))+1
Thank you. It's helpful.
 
Upvote 0
Thank you. It's helpful.
You are welcome but please note bebo021999's post #4 which explains why the simplification I suggested fails to count unique distinct values greater than AB3.
 
Upvote 0

Forum statistics

Threads
1,214,942
Messages
6,122,367
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