There has been some interest in Google Sheets in finding a faster way to assign sequence numbers to groups here. For interest using one of the suggested approaches (which is more or less linear in N, the number of rows of data) would look like this translated into Excel:
=LET(startrow,4,
rows,COUNTA(A:A)-1,
endrow,startrow+rows-1,
Data,INDEX(A:A,startrow):INDEX(C:C,endrow),
sData,SORTBY(Data,INDEX(Data,,1),1,INDEX(Data,,2),1,INDEX(Data,,3),1),
sRows,SORTBY(ROW(Data),INDEX(Data,,1),1,INDEX(Data,,2),1,INDEX(Data,,3),1),
ranks,SCAN(1,SEQUENCE(rows),LAMBDA(a,c,IF(c=1,1,IF(OR(INDEX(INDEX(sData,,1),c-1)<>INDEX(INDEX(sData,,1),c),INDEX(INDEX(sData,,2),c-1)<>INDEX(INDEX(sData,,2),c)),1,a+1)))),
SORTBY(ranks,sRows))
but clearly the extra complexity would only be worthwhile if you had a lot of data.

If you just wanted ranks based on the first and third columns and they were pre-sorted, the formula would be the much simpler:
=LET(startrow,4,
rows,COUNTA(A:A)-1,
endrow,startrow+rows-1,
Data,INDEX(A:A,startrow):INDEX(A:A,endrow),
SCAN(1,SEQUENCE(rows),LAMBDA(a,c,IF(c=1,1,IF(INDEX(Data,c-1)<>INDEX(Data,c),1,a+1)))))