Distributions
thanks to Jerry S.

Once upon a time I managed to get a spreadsheet up and running that plotted the distribution of returns. (The spreadsheet is described here.)
That spreadsheet had a macro which counted the number of returns in each of a collection of return intervals (or bins)

>Huh?
You stuck in a thousand returns running from, say, -20% to +50%, and the spreadsheet would divide the interval -20% to 50% into a hundred or so bins and determine how many of the thousand returns were in each interval (or bin) and ...

>And plotted them?
Exactly. You click a button and while you sip your coffee, a macro did the counting.

However, because of my limited experience with Excel ...
>And creeping senility?
... I didn't realize that there was an Excel command   FREQUENCY(returns, bins)   which did all this

>Didn't realize? Shame on you!
Pay attention.
I changed the spreadsheet described in the link above and also the download spreadsheet described here to include a plot of the return distribution using that neat FREQUENCY command.

The latest download spreadsheet ...

>Until you change it.
Uh ... yes. The latest download spreadsheet gives pretty pictures - something like this

>So, how do you use this frequency thing?
Okay, suppose you have a bunch of returns (or any other numbers!)
in cells A2 to A20 and the bins in column B ... as in Figure 1

  1. Select cells from D2 to D14 with your mouse.
  2. Type: =FREQUENCY(A2:A20,B3:B12)
  3. Press three keys simultaneously: Ctrl+Shift+Enter
Cells D2 to D14 will (compliments of the FREQ-function!) give the number of returns which lie in the various bins:
R<= -50%, -50% < R <= -40%, -40% < R <= -30%, ... and finally R> 60%
(You may want to put appropriate labels on a plot
... as I've done in column C.)

>That FREQ thing in D2:D14 has one more cell than the bins!
Yes, because FREQENCY counts the number less than the smallest bin and those greater than the largest bin and, besides, twelve bin numbers define thirteen intervals and ...


Figure 1
>Yeah. Nice, but what if I have 1000 numbers and want to count the number in, say, 10 bins.

Sorry 'bout that. Yes, you can have as many bins as you like ... so Figure 1 may be misleading.
For example, you might have 1000 stock returns in column A (from A2 to A1001) and 10 bins in column B (say from B2 to B11)
so you put, into column D (into D2 to D12, one more than the number of bins) =FREQUENCY(A2:A1001,B2:B11)
... with the magic Ctrl+Shift+Enter technique so it'll appear as {=FREQUENCY(A2:A1001,B2:B11)} in each cell of column D.