+ Reply to Thread
Results 1 to 4 of 4

vlookup / len function combined

  1. #1
    jamesg-fid
    Guest

    vlookup / len function combined

    I have many vlookups referencing cell A1/2/3.....with the text: "firstname".
    I now need to add to these cells: "last name".

    If I add this text, the vlookups search other data tables for "firstname
    lastname" and return errors. How can I amend the referenced cells
    (A1/2/3...) so that the vlookups only use "firstname" and disregard the added
    text ?

    Tks

  2. #2
    Simon Shaw
    Guest

    RE: vlookup / len function combined

    change the vlookup(A1,myTable,Column,range_lookup) to

    vlookup(left(A1,find(" ",A1)-1),myTable,...)

    assuming you have all cells as

    "firstname lastname"

    Simon

    "jamesg-fid" wrote:

    > I have many vlookups referencing cell A1/2/3.....with the text: "firstname".
    > I now need to add to these cells: "last name".
    >
    > If I add this text, the vlookups search other data tables for "firstname
    > lastname" and return errors. How can I amend the referenced cells
    > (A1/2/3...) so that the vlookups only use "firstname" and disregard the added
    > text ?
    >
    > Tks


  3. #3
    jamesg-fid
    Guest

    RE: vlookup / len function combined

    thanks! this works for peoples names.....


    Is this adaptable to cells that contain text rather than a persons first and
    last names ? For instance, would I be able to tailor this to a cell that
    contained a company name (rather than a persons name). So the cell could
    already be populated with, say, 3 words and I needed to add on a further 2
    words ? or perhaps the company name was 2, or 4 words and I needed to add
    on 1, or 4 words ?




    "Simon Shaw" wrote:

    > change the vlookup(A1,myTable,Column,range_lookup) to
    >
    > vlookup(left(A1,find(" ",A1)-1),myTable,...)
    >
    > assuming you have all cells as
    >
    > "firstname lastname"
    >
    > Simon
    >
    > "jamesg-fid" wrote:
    >
    > > I have many vlookups referencing cell A1/2/3.....with the text: "firstname".
    > > I now need to add to these cells: "last name".
    > >
    > > If I add this text, the vlookups search other data tables for "firstname
    > > lastname" and return errors. How can I amend the referenced cells
    > > (A1/2/3...) so that the vlookups only use "firstname" and disregard the added
    > > text ?
    > >
    > > Tks


  4. #4
    Simon Shaw
    Guest

    RE: vlookup / len function combined

    Yes, this can work for any cell where you want to take the text upto the
    first space, however, if you are trying to go for first two or three words it
    gets messy, but it is possible.

    As a rule, I try to keep individual data fields in separate columns, i.e.
    dedicate one columns to firstname, then another column for lastname... this
    also helps for various issues like sorting, subtotaling, filtering, etc.

    "jamesg-fid" wrote:

    > thanks! this works for peoples names.....
    >
    >
    > Is this adaptable to cells that contain text rather than a persons first and
    > last names ? For instance, would I be able to tailor this to a cell that
    > contained a company name (rather than a persons name). So the cell could
    > already be populated with, say, 3 words and I needed to add on a further 2
    > words ? or perhaps the company name was 2, or 4 words and I needed to add
    > on 1, or 4 words ?
    >
    >
    >
    >
    > "Simon Shaw" wrote:
    >
    > > change the vlookup(A1,myTable,Column,range_lookup) to
    > >
    > > vlookup(left(A1,find(" ",A1)-1),myTable,...)
    > >
    > > assuming you have all cells as
    > >
    > > "firstname lastname"
    > >
    > > Simon
    > >
    > > "jamesg-fid" wrote:
    > >
    > > > I have many vlookups referencing cell A1/2/3.....with the text: "firstname".
    > > > I now need to add to these cells: "last name".
    > > >
    > > > If I add this text, the vlookups search other data tables for "firstname
    > > > lastname" and return errors. How can I amend the referenced cells
    > > > (A1/2/3...) so that the vlookups only use "firstname" and disregard the added
    > > > text ?
    > > >
    > > > Tks


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1