Raymont
Raymont

Reputation: 293

How to set up groups in google sheets

Suppose I have the following table of users. How can I set groups of 5 as it appears in the group column? The idea is that each group contains 5 users.

user    group
1   1
2   1
3   1
4   1
5   1
6   2
7   2
8   2
9   2
10  2
11  3
12  3
13  3
14  3
15  3
16  4
17  4
18  4
19  4
20  4

Upvotes: 2

Views: 73

Answers (2)

basic
basic

Reputation: 11968

One more option:

=ArrayFormula(IF(LEN(A2:A),ROUNDUP((ROW(A2:A)-1)/5),""))

enter image description here

Upvotes: 2

player0
player0

Reputation: 1

try:

=INDEX(ROUNDDOWN(SEQUENCE(COUNTA(A1:A), 1, 0)/5)+1)

enter image description here

Upvotes: 3

Related Questions