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!
 

Some videos you may like

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

GlennUK

Well-known Member
Joined
Jul 8, 2002
Messages
11,519
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.
 

longtalker

New Member
Joined
Jan 31, 2009
Messages
28
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?
 

GlennUK

Well-known Member
Joined
Jul 8, 2002
Messages
11,519
A bin is counted as up to and including the bin value ... so 30 would be counted in the 30 bin.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,511
Messages
5,596,581
Members
414,079
Latest member
Frills

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
Top