Creating histograms with range bins rather than value bins

longtalker

New Member
Joined
Jan 31, 2009
Messages
28
Hello everyone,

Say I have a spreadsheet that contains the ages (rounded to integer number of years) of a bunch of people.

How can I create a histogram like this one, that has bins of the form 18-30, 31-43, 44-....., so in other words ranges of ages, rather than the Histogram tool's (Analysis ToolPak) default, which seems to be that each bin is *one* discrete value?

I know you can have text labels for the horizontal axis ("18-30", ...) but what I don't know is how you can make the Histogram tool understand that it should bin the frequencies in those numerical ranges, since the ranges would need to be stored as text in order for them to act as labels.

It would, of course, be fairly simple to do this in several steps (calculate the frequency of each age, then manually do a Column bar chart etc), but I'd like to be able to do in one step, using the Histogram tool (or some other, equally simple, way).

Many thanks in advance for any suggestions!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
You say "each bin is *one* discrete value" in the Histogram tool ... no, it's a boundary, so if you have a range containing 17, 30, 43, etc etc, and specify that as your bins, you'll get what you want.
 
Upvote 0
I see.. And how do I know whether an age value that is a 'border' (30, in our example) actually is counted in the bar on the left or in the one on the right?
 
Upvote 0
A bin is counted as up to and including the bin value ... so 30 would be counted in the 30 bin.
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,384
Members
448,956
Latest member
JPav

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