+ Reply to Thread
Results 1 to 7 of 7

Compare A to B(C) and insert C for A

  1. #1
    Registered User
    Join Date
    02-23-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Smile Compare A to B(C) and insert C for A

    Hello guys,

    I have a table with 4 columns:

    A is a list of numbers 12345, 23456, 34567 etc all unique, ascending sort
    B is a list of types, its either 1 or 11 or 3
    C is a list of the same numbers as A but they are not sorted and that cant be changed
    D is where I need to insert the type (1, 11, 3) for each number in C

    Ideally, it will take A2, find it in column Cxxx, and insert the type from B2 to Dxxx and continue doing it for each row

    Any ideas on how to do this?

    Thanks!
    Last edited by february24; 02-23-2010 at 12:31 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Compare A to B(C) and insert C for A

    =LOOKUP(C2,A:B) should do it if you have unique sorted list in column A..

    or =SUMIF(A:A,C2,B:B)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    02-23-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Compare A to B(C) and insert C for A

    Hi there,

    I just realized though that there are some dupes on the list. I have attached a screenshot maybe that will help

    Thanks!
    Attached Images Attached Images

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Compare A to B(C) and insert C for A

    The first LOOKUP() formula should pull up the last occurance of the lookup value... which I presume is the same for all duplicates....so shouldn't matter.. or does it somehow?

  5. #5
    Registered User
    Join Date
    02-23-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Compare A to B(C) and insert C for A

    Yes it is the same for all dupes but it wouln't do it for some reason the formula just stays there and doesn't display a value

  6. #6
    Registered User
    Join Date
    02-23-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Compare A to B(C) and insert C for A

    Okay, the formatting was wrong I had to format them all as numbers and that worked. Thanks, NBVC!

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Compare A to B(C) and insert C for A

    If you didn't want to format as numbers... then

    =Vlookup(C2,A:B,2,0)

+ 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