I am trying to make a list on Google sheets that increases according to the value of the number. So it would look like this as you go down: 2,2,4,4,4,4,6,6,6,6,6,6,8...
I have tried putting 2 in column A1 and below it putting this formula: =if(A2<(COUNTIF(A$2:A2,A2)),A2,+2)But all I get when I drag it down are rows of 2s.
Is there some way of combining if and countif so I can count how many occurences of the number in A2 there are, and once there are, say, four 4s, it adds 2 (and once there are six 6s, it adds two, and so on)?
Thanks
Tardy
Best Answer
You just need to change A2 to A1 otherwise you would be getting a circular reference:-
=IF(COUNTIF(A$1:A1,A1)<A1,A1,A1+2)