The VBA code on this page assumes that the source data for the histogram is in another workbook, and the histogram will be put on a new sheet in that workbook. It also contains a simple userform, which is only referred to on this page. You can copy the code and paste it into a VBA module, but it is easier to download the zipped workbook with the code. The macro calculates interval size, counts frequencies and makes the histogram chart. The second example shows how to make a histogram with a user defined number of columns. In the first example I show how to make a histogram with a bell shaped curve like in Microsoft's example (like the image at the top), and you don't need Analysis Toolpak. You can make histograms manually, if you have installed Analysis Toolpak, but it is tedious work (see a guide here) - it is much, much faster to use macros. To be sure about the normal distribution-thing you need to test statistically, but I'll leave that to you - this is about VBA! It could be the population's age distribution or quality data, and from the shape you get a pretty good idea if it is a normal distribution or not. I also show how to make a bell shaped curve with normal distribution and the same standard deviation and mean value as the histogram.Ī histogram is a graphical representation of data distribution. On this page I show how to make a histogram fast and easy in Excel with VBA macro code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |