Forum Discussion

Mak_Ludwig's avatar
Mak_Ludwig
Copper Contributor
Apr 07, 2020
Solved

Auto populate data based on unique values

Hello friends,   I am looking for a formula in Excel to auto generate values based on data in another column.   Example: Column A        Column B  Value x         Starting value = 1  Value y  ...
  • mathetes's avatar
    Apr 07, 2020

    Mak_Ludwig 

     

    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.)

     

     

Resources