View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Aaron Aaron is offline
external usenet poster
 
Posts: 59
Default Auto range of numbers detection

On Feb 23, 11:11 am, JE McGimpsey wrote:
Two questions:

1) what is your algorithm for "best fit"/"similar numbers"? Contiguous
values with a range of 4 or less? A step change of 6 or more between
values? Two digits vs. single digits?

2) By "group" do you mean the group and outline function, or something
else?

In article . com,



"Aaron" wrote:
Hi,


I am hoping someone could point me int he right direction on a problem
I have.


I have a series of conditions that give me a range of cells say a1 to
a10 all with a number in them. The number could be positive or
negative number in each cell.


How can I make excel automatically look at the range of numbers and
divide them up into groups of best fit.


The groups of best fit is just a logical arrangement of a group of
similar numbers in the same area, so I cant take a1, a5 and a10 and
group those numbers if they are the same or close to each other value
wise, because the numbers need to be grouped together from its
immediate surrounding numbers.


EG


10
11
12
10
10
4
6
8
22
25


In the above example I would group the numbers thus:


the first 5 together as one group,
the next 3 as another group,
and the last 2 as the last group.


At the moment its the only manual thing I do in my spreadsheet, and it
would be nice to fully automate this.


Any advice appreciated,


Cheers,


Aaron.- Hide quoted text -


- Show quoted text -


Contiguous values yes, but the range of 4 or less cannot be fixed as
the numbers for each calculation can differ in DP and in size. What
works for one range might not work for the next, which could be:

..004
..005
..0
..002
..005
..006
..008
..007
..003
..005

The deciding range limit in the above case as a human working it out,
would probably be

the first 2 numbers,
the second 2 numbers,
the following 4 numbers and
the last 2 numbers.

So 4 ranges.

It is interpreted on a case by case basis and as humans we can do it
straight away finding the best ranges. There are a maximum of 5
ranges, minimum of 1.

1 range would be all the numbers the same.

It is a hairy problem I know but I need a solution and it is beyond me
at the moment.

Abd when i say group I just mean in the literal sense that you have 4
groups or 4 ranges of numbers based on the 10 numbers presented. (as
in the above example)

In the first post, I had 3 ranges or groups of contiguous numbers.

Cheers,

Aaron.