Forum Discussion

NicGo2512's avatar
NicGo2512
Copper Contributor
Apr 09, 2020

Which text function to use to look up name in different coloums with different layout

Hi, I'm looking for which text or logical function to use to look up a name in different columns with a different layout. e.g. one column contains only the last name and the other column contain the last name with the initials and also some names are upper case and some are not

  1. Smith
  2. J.A. Smith

I want to see if in both lists the names are available and if so I need to add an lookup function to return a value from the other list.

Is there is a function that cuts of J.A. (not right function because list contain names with different lengths)?

 

Can anybody help me with that?

 

BR Nicole

5 Replies

  • mathetes's avatar
    mathetes
    Gold Contributor

    NicGo2512 

     

    There are functions that could help, but with what you've written I can only point you in their direction. You discount RIGHT, "because list contain names with different lengths" but have you considered combining RIGHT with LEN and FIND?

     

    For example, with your example of "J.A. Smith" in cell A1, this formula in B1

    =RIGHT(A1,LEN(A1)-FIND(" ",A1))

    delivers the result "Smith"  and it would also work with "A.B. Houghnagel"

     

    But of course, that works in part because I know that there's only one space in A1. If your actual files are inconsistent, which is more likely, you'd have to come up with more sophisticated formulas.

     

    Can you post a sample of your spreadsheets (without real names, but representative of the variety with which you're dealing)?

    • NicGo2512's avatar
      NicGo2512
      Copper Contributor

      Himathetes 

      Thank for you quick reply and input. I'm gonna try what you suggested. I attached an example of the file.

      What I need to check is the names in sheet1 are also in sheet2 if so, than I need to lookup the value that is in Sheet2 column C. Maybe this brings up some more ideas. 🙂 Appreciate your help thank you.

      • Riny_van_Eekelen's avatar
        Riny_van_Eekelen
        Platinum Contributor

        NicGo2512 

        Changed your Sheet2 into a structured table to make the formula more dynamic. Extend the table and the formulae will follow. The looking up of partial names is done by INDEX and SEARCH, but it only finds the first occurrence of the name. It can NOT differentiate between "A. Smith" and "B. Smith" based only on a search for "Smith".

        So, it might not be useful. But perhaps it will. See attached!

Resources