Search code examples
excelexcel-formulaformulavlookup

Excel Formula Issue Compare partial fields


I have 4 columns in excel. Colum "A" has 32,000+ Lines of file names. Column "L" has a 2 position Schema Code with 56 entries, Column "M" has the Schema Description (again 56 entries) and column "E" is empty at the moment.

I need to match the first two positions of column "A" to Column "L" and if I have a match I need to populate Column "E" with the value of the matching line (Schema Description) from Column "M". If there is no match, it must say "Not Provided".

My formula below is not working. Everything fills in as "Not Provided" Can anyone see where I am going south?

My Data Looks like this ....

Col "A"    COL "L"   Col "M"

AD001FM    AD        Adjustments

=IF(ISERROR(VLOOKUP(LEFT(A1,2),L2:L57,1,FALSE)),"Not Provided",M2)

Regards, -Ron


Solution

  • There are quite some options for you depending on your version of Excel. For example in E1 start with:

    =IFERROR(VLOOKUP(LEFT(A1,2),L$1:M$56,2,0),"Not Provided")
    

    And drag this formula down. However, if you would have Microsoft365, there are easier formulea like:

    =FILTER(M$1:M$56,L$1:L$56=LEFT(A1,2),"Not Provided")
    

    Or:

    =XLOOKUP(LEFT(A1,2),L$1:L$56,M$1:M$56,"Not Provided")