Search code examples
excelexcel-formulaexcel-2010excel-2007

Find the Last Cell Value of the 2nd Column Set for each 1st Column Cell in EXCEL


I have the following structured table in excel where 1000s of rows included.

enter image description here

I want to return the Last Cell Value of Column B for Each value in Column A.

For example:

  1. For Cell A1 -> I want to return the Cell B5.
  2. For Cell A6 -> I want to return the Cell B9.

I have tried with VLOOKUP, HLOOKUP, INDEX likewise so many formulas where I ended with more conflict situations. Can anyone please write down a Formula to give my requirement a life?


Solution

  • Array formula (Press Control + Shift + Enter while entering the formula) in cell C1 and copy it down.

    =IF(A1="","",IFERROR(INDEX($A2:$B$20,MATCH(FALSE,ISBLANK($A2:$A$20),0)-1,2),LOOKUP(2,1/(B2:$B$20),B2:$B$20)))
    

    enter image description here