Forum Discussion
IanaMac
Oct 17, 2021Brass Contributor
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 ...
- Oct 17, 2021
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.
OliverScheurich
Oct 17, 2021Gold Contributor
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.
IanaMac
Oct 19, 2021Brass Contributor
Many thanks it seems to work, i am actually now looking at some VBA Code.... 🙂
Appreciate the help and suggestion
Appreciate the help and suggestion