Forum Discussion
Auto populate data based on unique values
- Apr 07, 2020
In the following formula, I do make the assumption that you enter the starting value in cell B1. This formula then works when you copy it all the way down as the attached spreadsheet shows.
=IFS(AND(A2<>A1,B1=5),1,A2<>A1,B1+1,A2=A1,B1)
(I haven't tried it, but it stands to reason that you could switch around the sequence of those conditions and their consequences, for example, first checking whether A2=A1 and then leaving the value in column B the same. This just happens to be the way I wrote it.)
In the following formula, I do make the assumption that you enter the starting value in cell B1. This formula then works when you copy it all the way down as the attached spreadsheet shows.
=IFS(AND(A2<>A1,B1=5),1,A2<>A1,B1+1,A2=A1,B1)
(I haven't tried it, but it stands to reason that you could switch around the sequence of those conditions and their consequences, for example, first checking whether A2=A1 and then leaving the value in column B the same. This just happens to be the way I wrote it.)