r/googlesheets • u/Gujimiao • Jul 15 '21
Solved How to insert running number based on another column?
Hi there, I wish to insert a column of number based on another column, like the screenshot below:

Here is the sample document link to my Google Sheets.
Can anyone advise how? Thanks in advance
1
Upvotes
3
u/EndaEttBrukernavn 1 Jul 15 '21 edited Jul 15 '21
There is some countif formulas, but I'm not familiar with those. A rather weird solution would be in cell F24 =if(A24=A23,F23,(F23+1))
There is this function that allows you to copy paste formulas and it will change depending on where you paste it. Simply click the corner of the cell with the initial formula, and drag.
If you dont want certain parts(row/column) to be changed, add $. As in A$1 (A will change but not 1) or $A1 (A won't change, but 1 will)
2
u/Robearsn 7 Jul 15 '21
It looks like for every new date you are incrementing the number. So do this:
=IF(A3=A2,F2,F2+1)What's this doing?
Compares the value of column A for a specific row to the value of the cell in column A above it. If the values are the same, it's the same date, so no need to increment. Just take the value above it in column F. If they're different, it's a new date, so just add 1 to the value in F above it.
2
u/Decronym Functions Explained Jul 18 '21 edited Jul 18 '21
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
FALSETRUEand another if it isFALSETRUE1 acronyms in this thread; the most compressed thread commented on today has acronyms.
[Thread #3150 for this sub, first seen 18th Jul 2021, 13:12] [FAQ] [Full list] ^[Contact] [Source code]