+ Reply to Thread
Results 1 to 3 of 3

Searching and adding a value.

  1. #1
    rmg
    Guest

    Searching and adding a value.

    Hi,

    I have 1 workbook with 2 worksheets.

    Worksheet 1 has:
    Column a
    nm123
    mf837
    mn187
    lk193

    Worksheet 2 has:
    Column a Column b
    kd298 x
    er549 x
    jk981 y
    nm123 x
    mf837 x
    lp182 y
    nj765 y
    mn187 t

    As you can see, three of the values in worksheet 1 column a are also in
    worksheet 2 colum a.

    If that is the case I want to populate worksheet 1 column b with the
    relevant value from worksheet 2 column b

    e.g. in worksheet 1 I would end up with:

    Column a Colum b
    nm123 x
    mf837 x
    mn187 t
    lk193 (Blank because its not in worksheet 2 column a

    I think I can do it with a VLOOKUP but Im struggling with what to put
    in.

    Please can anyone help?

    Thanks.

    --
    rmg.
    gmail is a spamtrap
    use rmgwmyahoocouk


  2. #2
    Forum Contributor
    Join Date
    06-01-2006
    Posts
    324
    Put this in Sheet1, B1

    =IF(COUNTIF(Sheet2!$A:$A,A1)>0, VLOOKUP(A1,Sheet2!$A:$B,2,FALSE), "")

    You have to put the if statement in there or else you are going to get #N/As
    Google is your best friend!

  3. #3
    rmg
    Guest

    Re: Searching and adding a value.


    Bearacade wrote:
    > Put this in Sheet1, B1
    >
    > =IF(COUNTIF(Sheet2!$A:$A,A1)>0, VLOOKUP(A1,Sheet2!$A:$B,2,FALSE), "")
    >
    > You have to put the if statement in there or else you are going to get
    > #N/As


    Thank you very much Bearacade.

    --
    rmg.


+ 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