Forum Discussion

IanaMac's avatar
IanaMac
Brass Contributor
Oct 17, 2021
Solved

Auto Increment cell based on another Vaue

Hi all firstly i am no Excel expert so please treat me gently!!!!   I have inherited a big excel job were the finance division are enter large data into SQL thats being worked but by question here ...
  • OliverScheurich's avatar
    Oct 17, 2021

    IanaMac 

    I suggest to enter formula below in the first empty cell of column B (in my example B27). Please see attached file.

    Formula searches for the last occurence of e.g. "BTP" in column A and looks up the corresponding value in column B (and increments by 1).

    =XLOOKUP(A27,$A$1:$A26,$B$1:$B26,,0,-1)+1

    In my example i have a small dataset but formula can be adapted to bigger ranges.

Resources