Forum Discussion
sorting binary data
jjonescity Attached is one way that you can summarize the data as you described. I'm sure there are more elegant ways to do it, but this works. I added a few helper columns to work through the steps as you can see.
The key to a few of the helper columns is to use a range reference that starts with a fixed reference and goes to a relative reference, like $D$9:$D9. When you fill the formula down, the range reference will grow to include the current row and the rows above it.
For example, the formula in the "Previous" column is =IF(G14="","",XLOOKUP(F14,$F$9:$F13,$G$9:$G13,0,,-1)). In the screen shot below, the formula is on row 13, and the range references start at row 9 (fixed) and go to row 13 (relative, current row). This formula finds the previous value in the Total column for the Type that's in the current row.