Forum Discussion
jjonescity
Jul 01, 2024Copper Contributor
sorting binary data
I have some pump runtimes that I'm wanting to condense into readable and presentable data. I have a snippet of a sample table that shows the data I'm working with on a larger scale. I have some pre...
PeterBartholomew1
Jul 01, 2024Silver Contributor
A rather long and tedious 365 formula.
= LET(
pumps, Pump1&Pump2,
change?, pumps <> DROP(VSTACK("",pumps),-1),
new?, DROP(VSTACK(change?,TRUE),1),
accum, SCAN(0, change?, LAMBDA(acc,c?, IF(c?, 1, acc+1))),
status, SWITCH(FILTER(pumps, new?), "00", "Both off", "10", "Pump1 on", "01", "Pump2 on", "Both on"),
time, FILTER(accum, new?),
HSTACK(status, time &"min")
)