Forum Discussion
Nick2000
Mar 19, 2024Copper Contributor
Extracting round values from an interval
Hello everybody, I'm really strugling with something here, I'm not even sure if the title is correct 40.5 - 67.5 Let's say I have these 2 values (40.5 is A1 and 67.5 is C1), I'm trying to f...
- Mar 19, 2024
Try this:
=LET( a,SEQUENCE(ROUNDDOWN(C1,0)-ROUNDUP(A1,0)+1,,ROUNDUP(A1,0),1), b,MOD(a,5)=0, d,FILTER(a,b), d)
PeterBartholomew1
Mar 23, 2024Silver Contributor
A slightly more verbose style that may be easier to read.
= LET(
start, CEILING(bottom, 5),
end, FLOOR(top, 5),
intervals, 1 + (end - start) / 5,
SEQUENCE(intervals, , start, 5)
)
If called for, you may need to check that 'intervals > 0'.
...
IF(intervals > 0, SEQUENCE(intervals, , start, 5), "None")
)