+ Reply to Thread
Results 1 to 17 of 17

match values

  1. #1
    Registered User
    Join Date
    11-26-2011
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2007
    Posts
    7

    match values

    Hi, i'm new at this forum, and i have difficulties with a formula in my worksheet.

    I have a excel sheet with 3 rows.

    In row A i have about 1000 customer numbers.
    In row B i have their email adresses.
    In row C i have about 500 of the 1000 customers.

    I want to match the customers in row C with the customers in row A, and then extract their email adresses.

    Or if you see it in another way, i want to remove the customers in row A that does not match the customers in row C. I would then see which 500 customers that are left, and i would have their email adresses displayed in row b.

    The whole clue with my question is that i want to find out the email adresses of the 500 customers in row C.

    If anyone can help me with this, i am very grateful.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,036

    Re: match values

    Try this in D1 and pull down:

    =IF(ISNA(MATCH(C1,$A$1:$A$1000,0)),"",VLOOKUP(C1,$A$1:$B$1000,2,FALSE))
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    11-26-2011
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: match values

    Quote Originally Posted by zbor View Post
    Try this in D1 and pull down:

    =IF(ISNA(MATCH(C1,$A$1:$A$1000,0)),"",VLOOKUP(C1,$A$1:$B$1000,2,FALSE))
    Doesn't work, Excel marks that something is wrong with the formula. It marks the C1,$A$1 values after MATCH of the formula.

    I use excel 2007, if that has something to do with it. I also use english excel.

  4. #4
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: match values

    Does your version use semicolons instead of commas as separators? I don't see anything wrong with zbor's formula, save that it could be shortened to =IFERROR(VLOOKUP(C1,$A$1:$B$1000,2,0),""). That puts the email addresses for your customers in column C into column D (or wherever you put it).
    Life is about perseverance. Remember: today's mighty oak tree is just yesterday's nut that held its ground.

    If you like a post, please rate it with the scales icon (top right).
    If you feel really indebted, please consider a donation to charity, such as Feed the Children or Habitat for Humanity.

  5. #5
    Registered User
    Join Date
    11-26-2011
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: match values

    Quote Originally Posted by darkyam View Post
    Does your version use semicolons instead of commas as separators? I don't see anything wrong with zbor's formula, save that it could be shortened to =IFERROR(VLOOKUP(C1,$A$1:$B$1000,2,0),""). That puts the email addresses for your customers in column C into column D (or wherever you put it).
    Ah, yeah, it looks like my version uses semicolons. I tried the formula you wrote, but it leaves empty cells. I have yet to mention that the list in row A and row C isn't sorted alfabetically, if that has anything to do with it. The list in row C looks more random than row A.

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,036

    Re: match values

    Doesn't mater. Only need to have exact match.

  7. #7
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: match values

    It will leave empty cells if no match is found. Keep in mind that VLookup is a very sensitive formula. "John Smith" and "John Smith " (notice the space at the end) are not the same thing. Any blank you see means that the corresponding cell does not appear exactly in column A.

  8. #8
    Registered User
    Join Date
    11-26-2011
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: match values

    oh ok. then i need a formula that will delete all characters from the cells, and just leave the numbers.

    I guess the formula will work like a charm when this is done

  9. #9
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: match values

    Wait...I thought you had numbers in A and emails in B. I'm confused. Could you please post an example workbook with the exact format (albeit dummy data) you're working with?

  10. #10
    Registered User
    Join Date
    11-26-2011
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: match values

    Quote Originally Posted by darkyam View Post
    Wait...I thought you had numbers in A and emails in B. I'm confused. Could you please post an example workbook with the exact format (albeit dummy data) you're working with?
    Ok, here's an example which looks like my original sheet. Row C contains both the name of the customer, and the customer id. Row A contains only the customer id. I guess if i can get a formula to extract the numbers from row C, then i can use one of the formulas above to connect customer id's from row A and C, to emails in row B ?

    Row C is an exact copy of my original sheet, with the same amount of spaces between characters and numbers.
    Attached Files Attached Files

  11. #11
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    365
    Posts
    2,243

    Re: match values

    Hello evisu,

    Try any of this in D1, copy down.

    =IFERROR(LOOKUP(9E300,SEARCH(A$1:A$14,C1),B$1:B$14),"")

    Or,

    =IFERROR(LOOKUP(9E300,MATCH("*"&A$1:A$14&"*",C1,0),B$1:B$14),"")
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  12. #12
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: match values

    one way to extract the numbers is
    =LOOKUP(9.99E+307,--MID(C1,MIN(FIND({1,2,3,4,5,6,7,8,9,0},C1&1234567890)),ROW(INDIRECT("1:"&LEN(C1)))))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  13. #13
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: match values

    If the ID is always six digits, replace C1 with Right(C1;6) in the formula I offered and it should work.

  14. #14
    Registered User
    Join Date
    11-26-2011
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: match values

    Quote Originally Posted by darkyam View Post
    If the ID is always six digits, replace C1 with Right(C1;6) in the formula I offered and it should work.
    Absolutely awesome. I'm almost there now. It works excellent in the dummy sheet. In the dummy sheet, the values in row A is formatted as text. With the green marker on each cell.

    In my original worksheet, excel just won't let me convert row A with the numbers to "text". I want the green markers. Then it will work.

  15. #15
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: match values

    Right(C1;6)+0 will convert the values in C to numbers, which should then match up with the values in A.

  16. #16
    Registered User
    Join Date
    11-26-2011
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: match values

    yes !! It works Thanks you so much, this will make my work so much easier. Absolutely awesome

  17. #17
    Forum Contributor
    Join Date
    11-08-2011
    Location
    Leeds
    MS-Off Ver
    Excel 2010
    Posts
    279

    Re: match values

    Wouldn't the quickest way to do this be,

    Copy and paste row A with the 1000 customers names into a different tab, E.g Sheet 2
    then Instert a coloum next to coloum B, Use a Vlookup, =VLOOKUP(B1,Sheet2!,A1:A1000,True,False) On the A1:A1000 you wil need to highlight them both and click F4, Then all you do is drag all the way to the bottom

    Then Filter Largest to smallest all the people with N/A are not on the list and can be deleted and the people you are left with will be on both list,

    And then If you need all 3 coloums in one spreadsheet open up a new one and copy using Right click paste speacial options then values has the picture 1,2,3 hope this is what you were looking for

    Thanks

+ 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