+ Reply to Thread
Results 1 to 9 of 9

searching characters problem

Hybrid View

Deci searching characters problem 05-27-2007, 11:49 PM
Paul Try this formula: ... 05-28-2007, 12:40 AM
Deci It doesn't work. Maybe I... 05-28-2007, 09:06 AM
daddylonglegs Try a small adjustment to... 05-28-2007, 11:32 AM
Deci It worked like a charm.... 05-28-2007, 01:09 PM
  1. #1
    Registered User
    Join Date
    05-26-2007
    Posts
    53

    Question searching characters problem

    I'm almost done with my project, but I run into the following problem:
    In column B of Sheet 1 I have an ID number that looks like "SJUD56YK78T". I need to search the first 3 characters of the ID in a data base that I have in Sheet 2 (column B). When I find it, I need to copy the corresponding make of the boat from Sheet2 Column A into Sheet 1 Column T.
    Thanks for any idea.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    Try this formula:
    =INDEX(Sheet2!A:A,MATCH(LEFT(B1,3),Sheet2!B:B,0))
    Put this in Sheet1 cell T1 and fill downward. This will return the value in column A of sheet2 where column B of sheet2 matches the first 3 characters of column B in sheet1.

    I assumed your 'database' on sheet2 only contains 3 characters, while column B on sheet1 contains the full ID.

  3. #3
    Registered User
    Join Date
    05-26-2007
    Posts
    53

    Unhappy

    It doesn't work. Maybe I should have given a sample of my database on sheet2 (actualy it is Sheet5 and is has a name, "Make"). In column A i have a name of a boat, in column B I have different sets of 3 characters. For the same make I can have 2 or 3 or 10 or more groups of 3 characters, all in column B, separated by space. Example:
    Column A Column B
    Action Craft SSU AQC
    Advantage AZD RBV STY HUJ KMD

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,695
    Try a small adjustment to Paul's sugested formula

    =INDEX(Make!A:A,MATCH("*"&LEFT(B1,3)&"*",Make!B:B,0))

  5. #5
    Registered User
    Join Date
    05-26-2007
    Posts
    53

    Smile

    It worked like a charm. Thanks a zillion to both of you!

  6. #6
    Registered User
    Join Date
    05-26-2007
    Posts
    53

    Unhappy

    However, I need to use the formula in a macro, so I input the following code:
    ActiveCell.FormulaR1C1 = "=INDEX(Make!A:A,MATCH(" * "&LEFT(RC[-" & VAR4 & "],3)" & " & " * ",Make!B:B, 0))""
    where VAR4 is the difference between column# of Make (column U) & column # of ID (column O), so VAR4=7.
    I get an error "type mismatch". What am I doing wrong?

+ 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