Batching sequential rows that are "like groups" with a formula
Here's what I want to do. Column A has values that I want to group by rows, as shown in Column B. So the first group of "x" rows is a "1", the second group of "y" rows is a "2", alternating as shown.
This is a lot of data so I can't have infinite helper columns.
Best Answers

Add the following columns:
Title: Row ID (system column AutoNumber)
Title: ROW# Formula: =MATCH([Row ID]@row, [Row ID]:[Row ID], 0)
Title: Value (Column A in your description)
Title: First Group Formula: =IF([ROW#]@row = 1, 1, IF(INDEX(Value:Value, [ROW#]@row  1) = Value@row, 0, 1))
Title: Group Number Formula: =COUNTIFS([First Group]:[First Group], @cell = 1, [ROW#]:[ROW#], @cell <= [ROW#]@row)

Answers

Add the following columns:
Title: Row ID (system column AutoNumber)
Title: ROW# Formula: =MATCH([Row ID]@row, [Row ID]:[Row ID], 0)
Title: Value (Column A in your description)
Title: First Group Formula: =IF([ROW#]@row = 1, 1, IF(INDEX(Value:Value, [ROW#]@row  1) = Value@row, 0, 1))
Title: Group Number Formula: =COUNTIFS([First Group]:[First Group], @cell = 1, [ROW#]:[ROW#], @cell <= [ROW#]@row)

That's the direction I was heading  the last column doesn't get me there, however. I tried to sum all the First Group at or prior to the current row with this formula: =SUMIF([First Group]:[First Group], [ROW#]:[ROW#] <= [ROW#]@row)
However, that just populated the column with the sum of every group (17).


Must have been a syntax or cache issue. In the end I just updated the sumif to sumifs (below), that worked. I then went and retried yours, which worked as well. Thanks for the help!
=SUMIFS([First Group]:[First Group], [ROW#]:[ROW#], <= [ROW#]@row)

Curious why use the ROW# vs just the Row ID? I was able to get both to work.

ROW# will update even if you move around the rows...

Ah, got it. If I have a unique serial number for each line I can use that as well. Thanks!

Yes that would work