Find out the preceding stage of an ID in Excel

Copper Contributor

Hi,

 

I possess several records. Column A displays the "ID," and column B indicates its current stage.

Over time, the stage associated with each ID changes. The updated stage is recorded in the same sheet (added as a new record).

I need to identify the preceding stage (only the stage immediately before, not all preceding stages) of an ID in column "C" relative to column "B".

If there is no preceding stage, then the cell should remain empty.

The table format is as follows.

 

IDCURRENT STAGEPREVIOUS STAGE 
123456A 
123457B 
123458C 
123459D 
123460E 
123456DA
123457EB
123458AC
123459ED
123460BE

 

*The above table is just a demonstration, the actual data table is much bigger than the shown one. 

 

Suggest a function so that I can easily find out the previous stage of an ID. (Suggest solution for Excel that do not involve VBA) 

 

Using Excel 365

 

2 Replies

@Rushi1995 

=XLOOKUP(A2,$A$1:A1,$B$1:B1,"",0,-1)

Riny_van_Eekelen_0-1712472156000.png