Excel Histogram How does it calculate bin width

Click For Summary
SUMMARY

The discussion focuses on creating a custom histogram in Excel, addressing the calculation of bin width. The user proposes using the formula for the number of bins, defined as k = 1.87(N - 1)0.40 + 1, and aims to determine bin width using the formula (MAX(data) - MIN(data)) / k. The user expresses concern over the resulting bin widths being non-intuitive, such as 1.111 - 2.222, and seeks suggestions for generating more sensible intervals, like 0 - 10 or 0.10 - 0.12.

PREREQUISITES
  • Understanding of histogram construction in data analysis
  • Familiarity with Excel formulas and functions
  • Basic statistical concepts, including binning and data range
  • Knowledge of data types and intervals in numerical datasets
NEXT STEPS
  • Research methods for rounding bin widths in histograms
  • Explore Excel's FREQUENCY function for histogram creation
  • Learn about data normalization techniques for better binning
  • Investigate alternative histogram libraries in Python, such as Matplotlib or Seaborn
USEFUL FOR

Data analysts, Excel users, and software developers interested in custom data visualization techniques and improving histogram accuracy.

Saladsamurai
Messages
3,009
Reaction score
7
Hey people,


I am trying to write my own histogram making code since the Excel one sucks IMO. I am having some trouble thinking the whole bin 'width' thing through though.
I plan on using the formula

number of bins = k = 1.87(N - 1)0.40 + 1​

Then I was going to figure out the bin width as

\frac{[MAX(data ) - MIN(data )]}{k}​

This will get me in the ball park, but it will result in bin widths that are sloppy like 1.111 - 2.222 and the like. They should be sensible intervals like: 0 - 10, 10 - 20... etc or 0.10 - 0.12, 0.12 - 0.14...etc
Anyone care to brainstorm on me with this? I was thinking I could do some sort of test on the data set to determine what decimal place the bin width needs to go out to.

Hopefully someone can decipher what I am talking about here and wants to jump on board! :smile:
 
Last edited:
Physics news on Phys.org
Any thoughts :smile:
 

Similar threads

Replies
7
Views
5K
  • · Replies 8 ·
Replies
8
Views
7K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
15K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
5
Views
3K
  • · Replies 3 ·
Replies
3
Views
8K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 4 ·
Replies
4
Views
6K