+ Reply to Thread
Results 1 to 23 of 23

finding partial text in an index match formula

  1. #1
    Registered User
    Join Date
    02-23-2013
    Location
    Washington state
    MS-Off Ver
    Excel 2010
    Posts
    13

    finding partial text in an index match formula

    Hi, I'm new to the forum - great posts and knowledge shown here - it's humbling!

    I'm converting a database with about 8000 entries using excel to edit, merge, and alter some large tables before I import it.

    My current challenge is this:

    I have 2 tables on Sheet 1 and Sheet 2:

    Sheet one is 700 names like the 2 rows shown in the image
    xlimg1.gif

    Sheet two has 5000 entries, but only one column of arranger names (not split into first/last)

    xlimg2.gif

    I am trying to get Sheet 2 to return the Arr ID number if it finds a match in Sheet 1.

    The formula below (in column A of Sheet2) works only if the name in Column B Sheet 2 is the last name only - which it never is) (actually, if the last name is the left most in the cell, more letters can be to the right of it and it still works). I thought the wildcards would take care of that - what am I missing?

    =INDEX(Sheet1!A2:C3,MATCH("*"&B2&"*",Sheet1!B2:B3,0),1)

    Help! (Thanks in advance - also, I probably have been unclear, I'll be happy to be more clear - but this kind of posting is foreign to me - I'm a musician)

  2. #2
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: finding partial text in an index match formula

    Is this what you mean?
    Attached Files Attached Files
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  3. #3
    Registered User
    Join Date
    02-23-2013
    Location
    Washington state
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: finding partial text in an index match formula

    Jacc - Yes! The formula is way beyond what I could come up with - but I understand most of it.

    My one question is why in the matchingnames.xlsx ss you attached, Julia Roberts returns "no Match" in cell D6 and G6? That name is in both tables? Julia Roberts should return a "5", not "no match" shouldn't she?

  4. #4
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: finding partial text in an index match formula

    It's because there are two Julia's and it will only find the first, I missed that.
    I'll take another look at it.

  5. #5
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: finding partial text in an index match formula

    I think I found a better solution. It's an array formula so you have to enter it with Ctrl+Shift+Enter.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: finding partial text in an index match formula

    If there is a Julia Roberts and a Julia T Roberts it will only find the first of those two. I don't know if that is an issue but this updated version will take care of that too.
    Formula now looking like a proper Excel array formula.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Jacc; 02-23-2013 at 08:22 PM.

  7. #7
    Registered User
    Join Date
    02-23-2013
    Location
    Washington state
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: finding partial text in an index match formula

    Jacc - thanks for your continuing attention to this! What cell does your improved formula get pasted into? What does the range j2:j6 refer to in the ss you attached?

    Or, if you would be willing to attach the updated formula in a revised MatchingNames spreadsheet, I can probably figure it out.

    Reminder - what I'm seeking - using your spreadsheet as an example - is:

    MatchingNames_Ss_ex.gif

    I need Column G to return the Arr ID in column A
    by looking up the Arr name in column H
    to see if they occur anywhere in columns B/C.

    If there need to be the Matching Help no (column D)
    and Help no (column F)
    I can add them, but I don't need them.


    Thanks,
    garyaw

  8. #8
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: finding partial text in an index match formula

    I have no idea how I manage to upload the wrong file two times in a row. Oh well, that's life.

    After lots of tinkering I decided to change strategy completely. I now compare the leftmost and the rightmost name in column H with columns C and B.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    02-23-2013
    Location
    Washington state
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: finding partial text in an index match formula

    Jacc - THANK YOU !

    Wow - your formula works great for many of my lookups!

    There are two issues: 1) a request. Right now, it shows a 0 (zero) when a name's not found in the lookup list, which I don't mind. But - for the many cells which don't have an entry at all (are blank) - could you add in the code so it just shows nothing? The one I know is: If(IsBlank(cell), "", rest of formula)

    I know this will be child's play for you!

    The second is an issue:

    The formula seems to work up to about row 880 in my ss. I have 2700 rows. From row 880 onward, it just gives me a #num error . . . When I have excel evaluate it - the "Large" entry has a BUNCH of zeros - hundreds of them, in the array shown in the evaluate formula box.

    I've never even seen the LARGE command, so I'm no help - I know!

    The first 800 rows work like a charm - THANKS!
    Gary

  10. #10
    Registered User
    Join Date
    02-23-2013
    Location
    Washington state
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: finding partial text in an index match formula

    Jacc - wondering if you might have a chance to alter the formula so the final 1700 rows would work - the first 800 do at this point. . . .

  11. #11
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: finding partial text in an index match formula

    I don't know why it's doing that. Also I'm far away from home now, working looong days, so my time is kind of limited.
    You're listed as running Excel 2007, the only thing I can offer right noe is to try it in Excel 2010 and see if it works there. There is nothing in the formula itself limiting the range to 880. As a temporary workaround you could split your data in batches of 800 but it may list the same Arr ID twice then if it finds the same name in two different batches.
    Anyone else reading this post that cares to step in?

  12. #12
    Registered User
    Join Date
    02-23-2013
    Location
    Washington state
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: finding partial text in an index match formula

    JACC -

    so sorry for not replying. I know it's been 8 months. I am finally trying to finish up this project. You asked in your private message from april if your final suggestion worked - partially, is the answer.


    I have about 800 that it worked for, and another 2000 that it gives me a #num error.

    I'll explore more and repost an updated request with screen shots...
    gary

  13. #13
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 365
    Posts
    2,406

    Re: finding partial text in an index match formula

    Hope it works with helper column
    Attached Files Attached Files
    Last edited by azumi; 12-23-2013 at 03:50 PM.

  14. #14
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 365
    Posts
    2,406

    Re: finding partial text in an index match formula

    Sorry wrong file
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    02-23-2013
    Location
    Washington state
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: finding partial text in an index match formula

    GETTING CLOSE - NEED A LITTE MORE HELP!

    It's been a long while - but I'm finally trying to finish this. Thank you Jacc and azumi, for your help so far!

    I'm (STILL) converting a database with about 8000 entries using excel to edit, merge, and alter some large tables before I import it.

    Sheet one is 655 names like A1:C5. Sheet two has 5000 entries, many are repeated multiple times, like G1:K7.

    Sheet one is a lookup table -Sheet 2 needs to return the Arr ID number EVERY TIME it finds a match in Sheet 1. azumi came up with a formula which works great to get arrID's- but only lists the first occurrence.

    For subsequent appearances of a name, the arrID is blank. Since some names appear 15 or 20 times in the 5000 rows, I need to have the arrID # show each time the name appears, not just the first time... Below - Julia T Roberts in G6 and Jack Nicholson in G7 both should show the appropriate arrID''s. Julia Black in G3 appropriately shows nothing, since she isn't in the arrID table (thanks for the formula, azumi)

    I"ve spent an hour trying to modify it to fix this - but I don't understand the formula in cells G2:G7 well enough to know how to adjust it. I assume it has something to do with the Countif function?

    Here's the formula I was given:
    =IFERROR(INDEX($A$2:$C$6,SMALL(IF(ISNUMBER(SEARCH(TRIM(LEFT(H2,SEARCH(" ",H2,1)-1))&" "&TRIM(RIGHT(SUBSTITUTE(H2," ",REPT(" ",LEN(H2))),LEN(H2))),TRIM($B$2:$B$6&" "&$C$2:$C$6))),ROW($A$2:$A$6)-ROW($B$1)),COUNTIF($K$2:K2,K2)),1),"")

    Could someone show me how to modify this to show arrID's more than just the first time they appear.

    Matching Names.jpg
    Last edited by garyaw; 09-07-2015 at 10:45 AM.

  16. #16
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: finding partial text in an index match formula

    Hello garyaw, long time no see!

    So all the names in Sheet 1 are unique? I don't think I got that before since the old formula takes care of multiple hits in sheet 1.

    In the workbook attached here the formula is a bit more simple and it does take care of multiple instances in sheet 2 instead.

    Reading through the old posts there seems to be an issue with names that are similar. Would it be a good idea to have an extra column with a warning that it is a dubious match?
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    02-23-2013
    Location
    Washington state
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: finding partial text in an index match formula

    Jacc -

    yes, LOONNGG time no see - thanks for the quick reply! I think I was a little fuzzy on which sheet did what originally. Yes, sheet one is a unique value (lookup) table. Sheet two will return multiple hits of many of the names. In rereading - azumi had stepped in at your request - and that's what I was trying to get to work...

    Your adjusted solution is much appreciated. azumi had come up with a helper Trim column I, since-I had asked originally to be able to handle names which were close (like those having a middle name or initial)

    I think it would be nice to point the dubious possibilities out - but instead of adding 2 more columns - Helper match and dubious match - could you show me an example of making the arrID number or cell of dubious matches a different color or format?

    Maybe the number 4 in G6 could be a different text color (btw - the columns don't need to be yellow, azumi had changed their color for ease of viewing.)

    Matching Names.jpg

  18. #18
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: finding partial text in an index match formula

    Surprisingly easy that conditional formula. For clarity I typically use a different font color in cells containing formula but I reckon you can handle the standard formatting.
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    02-23-2013
    Location
    Washington state
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: finding partial text in an index match formula

    Thanks!

    I adjusted the formula to my actual situation. It's working great, but for one issue. Any row that doesn't contain an entry yields arrID of 657 (see below). There are hundreds of blank rows with 657 in them over the thousands of total rows.

    The formula looks up the name in another sheet, named "tbl_Arr" (for table arrangers), which consists of A1:C651 (arrID, arr FN, arr LN) - The last entry in column A is arrID 657, which I assume is where the 6576 in cell c5 comes from.

    Everything else is fine, but that. If it could be caused by me entering the array formula incorrectly, it's because I may be doing just that... (I did have the formula shown in the cell entered as an array though - whether it was right, I'm not sure)

    below is a screen shot of part of the sheet. The formula shows up in the jpg, but because it's so small I pasted it just below also.

    Jacc - You've been very kind already. would you be able to tell me what's causing the 657 in cell C5?

    =IFERROR(INDEX(tbl_Arr!$A$2:$A$651,LARGE(IF(ISNUMBER(SEARCH(G5,TRIM(tbl_Arr!$B$2:$B$651&" "&tbl_Arr!$C$2:$C$651))),ROW(tbl_Arr!$A$2:$A$651)-ROW(tbl_Arr!$B$1)),1)),"")

    Matching Names.jpg
    Last edited by garyaw; 09-07-2015 at 07:02 PM.

  20. #20
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: finding partial text in an index match formula

    If a search value cell is empty, the SEARCH function goes looking for nothing in all the cells and finds it included everywhere. The LARGE function picks out the largest (last) rownumber and voilá.
    Here is a quick fix that should work.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  21. #21
    Registered User
    Join Date
    02-23-2013
    Location
    Washington state
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: finding partial text in an index match formula

    Jacc - worked perfectly. Thanks so much!
    Gary

  22. #22
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: finding partial text in an index match formula


    '''''''''''''''''

  23. #23
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: finding partial text in an index match formula

    A lot shorter formula here
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    And it's non-array.

+ 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