I noticed this request has come up a couple times. FWIW, here is a Q&D
bit of MatLab code (actually I run it under FreeMat) to dump data into a
histogram. I'm sure there's a tighter algorithm but this works-- you
may get a few 'lost' points at the top end depending on how your machine
and your Matlab clone work.
% simple histogram binner "hist.m"
% take any input array and bin it up. For first cut, just spec number
of
% bins and use min, max to set boundaries.
%
function [y,binvals] = hist(array,nbins);
%
%
%
if (nargin ~=2)
error('Usage: hist(array,nbins')
end
% get endpoints; damn the roundoffs, full speed ahead
low = min(array)-0.001;
high = max(array)+ 0.001 ;
delta = (high - low)/nbins;
j = 1;
while (low < high) %getting cute here- reusing the variable
% bracketed stuff returns logical 1 or 0 for true/false.
bin(j) = sum(array >= low & array < (low + delta));
binval(j) = low;
j = j + 1;
low = low + delta;
end
% need this only because I didn't use "y" and "binvals" inside loop
y = bin;
binvals = binval;
% there may be leftover values (at least one, the way I calc'd "high" ),
so
% y(j) = numel(array)-sum(bin);
%this leaves y longer than binvals. Tough noogies
% not clear to me (yet) why this isn't necessary. My last bin, i.e. low
+k*delta,
% somehow always manages to be slightly greater than max(array) . It is
a cumulative
% rounding error -- I have no idea whether it will always go "large"
-----
Use at your own risk :-)
In article <Ouev9MqYIHA.4808 RemoveThis @TK2MSFTNGP05.phx.gbl>,
"Mike Middleton" <mike RemoveThis @mikemiddleton.com> wrote:
> meperezs -
>
> Mac Excel 2008 does not have the Data Analysis features of the Analysis
> ToolPak, so there is no Histogram option.
>
> As a workaround, you can prepare a frequency distribution using the
> FREQUENCY array-entered worksheet function (or COUNTIF or a Pivot Table),
> and you can plot using the Column chart type.
>
> Another source is Jon Peltier's web site
> http://www.peltiertech.com/Excel/Charts/statscharts.html#Hist1
>
> - Mike Middleton
> http://www.DecisionToolworks.com
> Decision Analysis Add-ins for Excel
>
>
>
> <meperezs RemoveThis @officeformac.com> wrote in message
> news:ee8b2d3.-1@webcrossing.caR9absDaxw...
> Hello,
>
> I am attempting to do histograms in excel 2008. I know how to do it in the
> windows counterpart because of school, but I have homework to accomplish for
> the class and cant find the function anywhere in the mac side of business.
--
Team EM to the rescue!
http://www.team-em.com >> Stay informed about: Histograms