+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: 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
    Excel 2007
    Posts
    6,213

    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))
    "Relax. What is mind? No matter. What is matter? Never mind!"

  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 Guru darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Colorado, US
    MS-Off Ver
    2007
    Posts
    2,170

    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
    Excel 2007
    Posts
    6,213

    Re: match values

    Doesn't mater. Only need to have exact match.
    "Relax. What is mind? No matter. What is matter? Never mind!"

  7. #7
    Forum Guru darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Colorado, US
    MS-Off Ver
    2007
    Posts
    2,170

    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.
    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.

  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 Guru darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Colorado, US
    MS-Off Ver
    2007
    Posts
    2,170

    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?
    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.

  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
    Valued Forum Contributor Haseeb A's Avatar
    Join Date
    05-24-2011
    Location
    India | Kwt
    MS-Off Ver
    2007
    Posts
    1,453

    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),"")
    HTH; Haseeb

    If your problem is solved, please say so clearly, and mark your thread as Solved:
    Forum Rules & How to Mark a thread as SOLVED

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

    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 a dabbler in Cisco
    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 Guru darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Colorado, US
    MS-Off Ver
    2007
    Posts
    2,170

    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.
    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.

  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 Guru darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Colorado, US
    MS-Off Ver
    2007
    Posts
    2,170

    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.
    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.

+ 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.2.0