1 min readfrom 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?

https://preview.redd.it/li4k6h859cjg1.png?width=1442&format=png&auto=webp&s=93f76c376fae061919415df109a1296bbb5a1056

=SCAN(0,A1:A10, LAMBDA(acc,v, IF(acc<15, acc + v, acc)))

submitted by /u/CorndoggerYYC
[link] [comments]

Want to read more?

Check out the full article on the original site

View original article

Tagged with

#Excel alternatives for data analysis
#natural language processing for spreadsheets
#generative AI for data analysis
#rows.com
#Excel compatibility
#SCAN
#running sum
#condition
#evaluation
#list of numbers
#total
#repeat
#ended
#accumulator
#LAMBDA
#values
#A1:A10
#IF function
#greater than
#attempt