# Revision history [back]

### Generate the sum of values in a histogram bin

I have a table of sales, with each row being a time of sale and a sales amount. For example:

1:00    5.25
1:15    2.77
2:30    5.15
2:45    8.00
3:15    4.27


I want to be able to generate a chart showing the total sales by hour. Something that will export

1:00-1:59  8.02
2:00-2:59  13.15
3:00-3:59  4.27


I know the FREQUENCY function will create bins, but that will just show the number of sales I had at each hour, not the sum of the second column. Is there an array function (or work-around) that will: 1) take a table that can be sorted, 2) check to see if the value in column A is in a certain range, 3) add the value in column B to a sum specific to each range, and 4) output that sum?

Thanks in advance, and apologies if asked before -- my search skills weren't able to find anything like this.