0

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

tardy pigeon
  • 225
  • 6
  • 18
  • I'm not clear if 2,2,4,4,4,4... is what one cell should look like or if it's meant to be several cells? Could you show the first few cells of your output plz to clarify a bit more? – Tom Sharpe Apr 23 '16 at 07:51
  • Hi Tom. Not sure how to paste spreadsheet stuff here, but one number in each cell was what I was aiming at. So A1 and A2 would be 2, A3, A5, A6, and A7 would be 4, A8... would be 6. Hope that helps! – tardy pigeon Apr 23 '16 at 08:05

1 Answers1

0

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)

enter image description here

Tom Sharpe
  • 30,727
  • 5
  • 24
  • 37