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)
Patrick2788
Mar 20, 2024Silver Contributor
I may need to see a larger sample set of numbers but try this one:
=LET(
k, (C1 - A1) / 5,
arr, SEQUENCE(k, , A1 + 5, 5),
MROUND(arr, 5)
)
- Nick2000Mar 23, 2024Copper Contributor
Patrick2788 Thank you very much, it works with just a tiny "problem", if the value is already divisible by 5 (let's say it would've been 45 instead of 40.5 in my example) it just jumps to the next value (50 in my example), thank you so much for taking your time, I don't know what you refer to when you're saying by "larger sample set of numbers", because I need this formula only for 2 values (if you could explain a bit it would be great). That being said, have nice day and thanks again 🙂