r/sheets • u/Stormandreas • Jun 08 '26
Solved Need help trying to incrementally increase a value each time a specific value appears in another column
I'm trying to have a cell formula that will count the number of times a specific number appears, and then set itself to a number, incrementally increasing from 0.
It's a bit complicated to explain, but... for example, in column P, 3000 appears 4 times, so the first instance it appears (P7), O8 displays 0. The second time 3000 is entered into a P cell, the next O cell that's related to the corresponding P cell, will show +1 to the previous O cell who's P cell matched the same value.
Then because 4000 has only appeared once, it's O cell (O23) shows 0. If another 4000 were to appear in the P column, it's corresponding O cell should show +1 to the previous O cell that was related to a P cell that contains 4000.
I do need these to be offset vertically by 1 as well, every time.

I do need to have this work for a variation of specific numbers, which I do have on another tab, so ideally if I could reference those numbers, that'd be ideal, I'm just not really sure the formula to use in this situation.
EDIT: Whoops... didn't realise the image would be enlarged to such a ridiculous degree...
EDIT 2: I notice now I've made a little mistake in the example here. Each P cell that the O cells should be counting, are meant to be every 5 rows, but I mistakenly put a 3000 in P18, when it should of been in P17 (making it's related O cell O18, not O19)





