Formula explination

Skybluekid

Well-known Member
Joined
Apr 17, 2012
Messages
1,231
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I am using this formula, SUMPRODUCT((S2>=$S$2:$S$110)+0)+1, (S2 is a text string), which I got from searching on this forum.Not being one for just pasting formula's, I would like to understand how this works.

Thank you
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
1. The bit

(S2>=$S$2:$S$110)

returns an array of TRUE/FALSE evaluations: S2>=$S$2 >> TRUE, S2>=$S$3 either TRUE or FALSE, and so on.

2. SUMPRODUCT understands only numbers.

3. TRUE is 1 and FALSE is 0 in Excel.

4. TRUE+0 >> 1, FALSE+0 >> 0

5. By 2 to 4, the bit

(S2>=$S$2:$S$110)+0

returns an array of 1's and 0's.

6. The bit

SUMPRODUCT((S2>=$S$2:$S$110)+0)

returns each time a count where the comparison value S2, S3, etc. is >= than the values in $S$2:$S$110.

7. Adding 1 to each SUMPRODUCT yields a rank, just like the RANK() function would.
 
Upvote 0

Forum statistics

Threads
1,225,739
Messages
6,186,743
Members
453,370
Latest member
juliewar

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