•1 min read•from Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community
Is it possible to have the SCAN function stop evaluating after a condition is met?
I'm asking this to see if there are aspects of SCAN I do not understand. For example, say you have a list of numbers from 1 to 10 and you want to do a running sum but have the process end once the total hits 15. I can get the summing to end but can't figure out how not to repeat "15" for the rest of the values. Column B is my attempt, Column C is what I want to see at the end. Is this possible using SCAN?
=SCAN(0,A1:A10, LAMBDA(acc,v, IF(acc<15, acc + v, acc)))
[link] [comments]
Want to read more?
Check out the full article on the original site