+ Reply to Thread
Results 1 to 8 of 8

Compare 2 columns and retreive more than one column value

  1. #1
    Registered User
    Join Date
    12-24-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    99

    Question Compare 2 columns and retreive more than one column value

    Hi, I want to compare 2 column values in 'E' with values in 'A' and retreive all the column values from column 'A'. For example:

    Source:

    A B C D
    a 2 3 4
    d 6 6 7
    c 9 9 9
    z 1 2 4

    Destination:

    E F G H
    a 2 3 4
    c 9 9 9
    z 1 2 4

    If i want to lookup a value in column 'E' with value in column 'A' i want retrieve all the values from A to D which i am not able to do with a simple vlookup function.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Compare 2 columns and retreive more than one column value

    a simple vlookup should work here, make sure you use a 0 (or false) as the last argument, not 1 (or true). Use 1 (TRUE) if the list is sorted, 0 (FALSE) to return an exact match in unsorted data
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Valued Forum Contributor
    Join Date
    09-15-2011
    Location
    Chennai, India
    MS-Off Ver
    Excel 2010
    Posts
    436

    Re: Compare 2 columns and retreive more than one column value

    Are you looking for this result?
    Attached Files Attached Files
    Last edited by ramananhrm; 09-27-2013 at 12:41 AM.
    Please click 'Add reputation', if my answer helped you.

  4. #4
    Registered User
    Join Date
    12-24-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Compare 2 columns and retreive more than one column value

    Quote Originally Posted by ramananhrm View Post
    Are you looking for this result?
    Thanks ramananhrm! Thanks for all your effort! But i want to know if there is any way that these formulas are applied on just the column 'E' and then retreive all the column values from A to D instead of applying formulas on multiple columns (in this case columns 'F', 'G', 'H')?

  5. #5
    Registered User
    Join Date
    12-24-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Compare 2 columns and retreive more than one column value

    Quote Originally Posted by FDibbins View Post
    a simple vlookup should work here, make sure you use a 0 (or false) as the last argument, not 1 (or true). Use 1 (TRUE) if the list is sorted, 0 (FALSE) to return an exact match in unsorted data
    Could you please explain a bit more? Thanks!

  6. #6
    Valued Forum Contributor
    Join Date
    09-15-2011
    Location
    Chennai, India
    MS-Off Ver
    Excel 2010
    Posts
    436

    Re: Compare 2 columns and retreive more than one column value

    If im not wrong, this should be the result.

    Rgds,
    Attached Files Attached Files
    Last edited by ramananhrm; 09-27-2013 at 01:57 AM.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Compare 2 columns and retreive more than one column value

    A
    B
    C
    D
    E
    F
    1
    a
    2
    3
    4
    a
    2
    2
    d
    6
    6
    7
    c
    9
    3
    c
    9
    9
    9
    d
    6
    4
    z
    1
    2
    4
    z
    1


    F1=VLOOKUP(E1,$A$1:$D$4,2,0)

  8. #8
    Registered User
    Join Date
    12-24-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Compare 2 columns and retreive more than one column value

    Quote Originally Posted by FDibbins View Post
    A
    B
    C
    D
    E
    F
    1
    a
    2
    3
    4
    a
    2
    2
    d
    6
    6
    7
    c
    9
    3
    c
    9
    9
    9
    d
    6
    4
    z
    1
    2
    4
    z
    1


    F1=VLOOKUP(E1,$A$1:$D$4,2,0)
    Hi FDibbins,

    This will fetch me only values for F column from column B. What i am looking for is, i want to compare values in 'E' column with 'A' column. If there is a match, values in corresponding columns B,C and D should be appearing in F, G and H columns respectively. Is there any way to achieve this by using formula in 'E' column? Thanks for your patience and support!

    Regards,
    Pavan Kumar

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Compare 2 columns and copy new values from the 2nd columns to a 3rd column
    By djarcadian in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-02-2013, 12:18 PM
  2. Best match function to retreive the closest value based on 2 columns
    By Aspe in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-03-2012, 11:17 AM
  3. Retreive information from specific columns
    By Canuck. in forum Excel General
    Replies: 6
    Last Post: 08-11-2009, 05:54 AM
  4. [SOLVED] Retreive data from another worksheet based on multiple columns
    By hgopp99 in forum Excel General
    Replies: 6
    Last Post: 01-22-2006, 10:30 AM
  5. Retreive data from another worksheet based on multiple columns
    By hgopp99 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 01-20-2006, 04:50 PM

Tags for this Thread

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