I'm trying to find a formula to return a value that represents the count of intervals at a certain increment size within a range. For example:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]RULE[/TD]
[TD]FROM[/TD]
[TD]TO[/TD]
[TD]BY[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]12[/TD]
[TD]90[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]1.75[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]4[/TD]
[TD]50[/TD]
[TD]3[/TD]
[/TR]
</tbody>[/TABLE]
Rules:
The returned value must include the starting point "FROM" value as a count of one interval.
If the "TO" rule is not evenly divisible by the "BY" increment, the last interval point inside of the range is counted. For example, in a range of 10 to 30 at increments of 3, the last possible point is at 28:
If it is evenly divisible, obviously the end of the range is included (30, if the range was 10 to 30 by 2).
10 to 30 by 3:
10
13
16
19
22
25
28
For a count of 7.
It is the count that I'm trying to write a formula for.
Any ideas?
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]RULE[/TD]
[TD]FROM[/TD]
[TD]TO[/TD]
[TD]BY[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]12[/TD]
[TD]90[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]1.75[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]4[/TD]
[TD]50[/TD]
[TD]3[/TD]
[/TR]
</tbody>[/TABLE]
Rules:
The returned value must include the starting point "FROM" value as a count of one interval.
If the "TO" rule is not evenly divisible by the "BY" increment, the last interval point inside of the range is counted. For example, in a range of 10 to 30 at increments of 3, the last possible point is at 28:
If it is evenly divisible, obviously the end of the range is included (30, if the range was 10 to 30 by 2).
10 to 30 by 3:
10
13
16
19
22
25
28
For a count of 7.
It is the count that I'm trying to write a formula for.
Any ideas?
Last edited: