On Sat, 05 Apr 2008 21:52:35 -0400, Ron Rosenfeld
<(E-Mail Removed)> wrote:
>On Sat, 5 Apr 2008 19:02:37 +0100, hankach
><(E-Mail Removed)> wrote:
>
>>
>>Hi all ,
>>
>>
>>In a row i have : A1= 450 B1=560 C1=500 D1=510 E1=445 F1=430 G1= 420
>>
>>Those values represent several weights of a product prepared in this
>>case 7 times, now that i want to decide what is the most relative
>>weight to use on my list, i need a formula to tell me what is the most
>>frequent bin scored given a difference of 50 grs maximum .
>>The formula should return the following answer : 400-450 which means
>>that the most frequent weight bin is between 400 and 450 grs , now the
>>50 should be variable so if i change it somehow in the formula to 100
>>it should return 400-500 which means that the most frequent weight bin
>>falls between 400 and 500 grs.
>>
>>Any smart frequency formula can do that ?
>>
>>i appreciate anyone's help, thank you much.
>
>Given the following named ranges:
>
>rng refers to: your data range
>BinSize refers to: a cell containing the bin size
>
>Then the lower bound of your first most frequent weight bin is:
>
>=INDEX(ROW(INDIRECT(FLOOR(MIN(rng),BinSize)/BinSize&":"
>&CEILING(MAX(rng),BinSize)/BinSize))*BinSize,-1+MATCH(MAX(
>FREQUENCY(rng,ROW(INDIRECT(FLOOR(MIN(rng),BinSize)/BinSize&
>":"&CEILING(MAX(rng),BinSize)/BinSize))*BinSize)),FREQUENCY(
>rng,ROW(INDIRECT(FLOOR(MIN(rng),BinSize)/BinSize&":"
>&CEILING(MAX(rng),BinSize)/BinSize))*BinSize),0))
>
>and the upper bound is:
>
>=INDEX(ROW(INDIRECT(FLOOR(MIN(rng),BinSize)/BinSize&":"
>&CEILING(MAX(rng),BinSize)/BinSize))*BinSize,MATCH(MAX(
>FREQUENCY(rng,ROW(INDIRECT(FLOOR(MIN(rng),BinSize)/BinSize&
>":"&CEILING(MAX(rng),BinSize)/BinSize))*BinSize)),FREQUENCY(
>rng,ROW(INDIRECT(FLOOR(MIN(rng),BinSize)/BinSize&":"
>&CEILING(MAX(rng),BinSize)/BinSize))*BinSize),0))
>
>If you need it all in one cell, you can concatenate the two formulas:
>
>=INDEX(ROW(INDIRECT(FLOOR(MIN(rng),BinSize)/BinSize&":"
>&CEILING(MAX(rng),BinSize)/BinSize))*BinSize,-1+MATCH(MAX(
>FREQUENCY(rng,ROW(INDIRECT(FLOOR(MIN(rng),BinSize)/BinSize&
>":"&CEILING(MAX(rng),BinSize)/BinSize))*BinSize)),FREQUENCY(
>rng,ROW(INDIRECT(FLOOR(MIN(rng),BinSize)/BinSize&":"
>&CEILING(MAX(rng),BinSize)/BinSize))*BinSize),0))&"-"&
>INDEX(ROW(INDIRECT(FLOOR(MIN(rng),BinSize)/BinSize&":"
>&CEILING(MAX(rng),BinSize)/BinSize))*BinSize,MATCH(MAX(
>FREQUENCY(rng,ROW(INDIRECT(FLOOR(MIN(rng),BinSize)/BinSize&
>":"&CEILING(MAX(rng),BinSize)/BinSize))*BinSize)),FREQUENCY(
>rng,ROW(INDIRECT(FLOOR(MIN(rng),BinSize)/BinSize&":"
>&CEILING(MAX(rng),BinSize)/BinSize))*BinSize),0))
>
>Note that if there is more than one bin that is equally "most frequent", this
>will return the "first" bin (the one with the lowest value).
>--ron
I think there will be a problem with your formula Ron, if the minimum
value in the range is less than BinSize. The FLOOR function then
yields 0 and that will annoy the INDIRECT function.
Lars-Åke