Hi,

I need some help to count the number of values between some range.

```
var listSource = new List<double>();
listSource.Add(10);
listSource.Add(15);
listSource.Add(22);
listSource.Add(30);
listSource.Add(35);
listSource.Add(40);
listSource.Add(42);
listSource.Add(45);
//number of classes -> in this case will be 3
int nClasses = Convert.ToInt16(Math.Round(Math.Sqrt(listSource.Count)));
//retrieve max and min values
double minValue = listSource.Min();
double maxValue = listSource.Max();
//calculation of step interval
double step = (maxValue - minValue) / nClasses;
//this list contains the limits of the classes
List<double> list_steps = new List<double>();
list_steps.Add(minValue);
for (int i = 0; i < nClasses; i++) {
list_steps.Add(list_steps[i] + step);
}
//now start my problem
```

At this moment I have:

- list with values (10,15,22,30,35,40,42,45)
list with ranges (10, 21.6 , 33.33 , 45)

I want to retrieve a list containg the count:

values between 10 and 21.6 -> 2

values between 21.6 and 33.33 -> 2

values between 33.33 and 45 -> 4But all this listSource and list of ranges are dynamic, i cannot input a condition like if....

Any ideas :(

Thanks in advance.