+ Reply to Thread
Results 1 to 12 of 12

find a name in a list instead of absolute reference

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    05-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    186

    find a name in a list instead of absolute reference

    Hi all,

    I'M back for help again. I am having trouble working with an expense report file. People manually input their expenses and aren't always good about keeping the naming conventions correct to help me sort them (I can't add anything to the system to force them into giving me good data or I would). each description has at minimum their last name. I also have a listing of all Employee names. Here is what I am trying to do.

    In the workbook I have the list of names in COlumn H and the field with the last name somewhere in column A
    I currently have a formula
    =MID(A2,FIND(H2,A2),15)
    This only works if I link the formula to a cell in H with the correct employee description in A. If I don't I will get an error.

    Is there a way, VBA or otherwise, to get the formula to check through the list and find the correct last name to pull out?

    Thanks in advance,
    smls

  2. #2
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: find a name in a list instead of absolute reference

    sure, with your file.

  3. #3
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: find a name in a list instead of absolute reference

    Hi
    Try using Data Validation
    Suppose H2:H30 as complete Names
    Use in A2 Data validation customized with this formula
    Formula: copy to clipboard
    =COUNTIF($H$2:$H$30,"*"&A2&"*")=1  

    You can copy special data validation for other cells f column A

  4. #4
    Forum Contributor
    Join Date
    05-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    186

    Re: find a name in a list instead of absolute reference

    Not quite sure I follow, here's a test file that kind of illustrates it.
    Attached Files Attached Files

  5. #5
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: find a name in a list instead of absolute reference

    Hi
    Please clarify. Your column H has only Last names? Column A has the input data? In the example Column B has the names (First, Last) or (Last Two) or (something and Last)?

  6. #6
    Forum Contributor
    Join Date
    05-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    186

    Re: find a name in a list instead of absolute reference

    Column A has the input data from the system with the mixing of names and line details. Column B simply has the mid formula I wanted to make work but couldn't. H is only last names in the test file. In the real file it has both but I can easily make it last name only if that's needed.

  7. #7
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: find a name in a list instead of absolute reference

    Hi
    I assum that H2:H60 has Last names, I2:I60 has Complete names
    Use in D2 the following formula and drag down
    Formula: copy to clipboard
    =INDEX($I$1:$I$60,SUMPRODUCT(ROW($H$2:$H$60)*COUNTIF(A2,"*"&$H$2:$H$60&"*")))

    In J2 I add a new formula to see if last names is unique inside complete names. If not then you can adapt Last name as I do with Smith.

    See the file for clarification.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    05-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    186

    Re: find a name in a list instead of absolute reference

    I think you misunderstand the objective.

    I am trying to get the last name, or full name if possible, appear in column B. That would need me to find it inside of the String in A and pull it out. This would need to reference the list in H. My mid formula was getting me what I wanted in that one instance, it just doesn't work to give me what I want for the entire list.

    So moving through it I would want column B to read Zimmer, Smith, Jordan, Smith, Brown. Or some variant of the last name appearing in the column.

    Column B would then be used to determine which people each expense was allocated to.

    Your formula appears to only tell me if the name exists. As they are already in the system it's past the validation to be paid part of the process. This is now an allocation to person and department.

    Does that make sense?

  9. #9
    Forum Contributor
    Join Date
    05-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    186

    Re: find a name in a list instead of absolute reference

    Or did I misunderstand the formula in the sheet you re-posted? Also, I couldn't get it to execute False or "xx".

  10. #10
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: find a name in a list instead of absolute reference

    Hi
    It works fine for me. I download the file and it gives the complete name in D2:D7 and Ok in J2:J6
    see the image
    Capturar.JPG
    and the same file
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    05-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    186

    Re: find a name in a list instead of absolute reference

    I must have looked at something else before, or be going insane, either way I was wrong, this file works. I see what you did, just had to adjust the Complete names and my brain started working. Much appreciated. Great solution to it. I think I'm following it. +rep :D

  12. #12
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: find a name in a list instead of absolute reference

    I'm glad to have helped.
    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 03-02-2016, 07:05 AM
  2. Replies: 6
    Last Post: 02-05-2016, 12:35 PM
  3. Replies: 5
    Last Post: 09-21-2012, 02:08 PM
  4. Replies: 0
    Last Post: 11-15-2007, 02:35 AM
  5. absolute cell reference in R1C1 reference style
    By Prorocentrum in forum Excel General
    Replies: 1
    Last Post: 06-18-2007, 04:59 PM
  6. Making VLookup Absolute reference and deleting worksheet reference question
    By crowdx42 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-24-2006, 12:45 PM

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