+ Reply to Thread
Results 1 to 13 of 13

need help with formula to compare columns and add vaule for matches

  1. #1
    Registered User
    Join Date
    02-04-2014
    Location
    ohio
    MS-Off Ver
    Excel 2003
    Posts
    14

    Unhappy need help with formula to compare columns and add vaule for matches

    I need to compare values in column A to all values in column B and when a match is found enter the corresponding data in column C (same row) into column D. There are 8741 rows in column a, 2708 in column B & C. 0 in column D currently. Please help





    A1 B1 C1 D1

    x y orange blue

    y x blue orange

    z z red red
    Last edited by cavsfan; 02-04-2014 at 02:38 PM.

  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,946

    Re: need help with formula to compare columns and add vaule for matches

    Hi and welcome to the forum

    Based on your sample data, try this, copied down...
    =INDEX(C:C,MATCH(A1,B:B,0))
    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
    Registered User
    Join Date
    02-04-2014
    Location
    ohio
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: need help with formula to compare columns and add vaule for matches

    thanks for the welcome.... I am a beginner with excel.

    I attempted to copy the formula =INDEX(C:C,MATCH(A1,B:B,0)) into D2 and hit enter and nothing happens, just see formula in D2. I copy it down and again just see the formula???

  4. #4
    Registered User
    Join Date
    02-04-2014
    Location
    ohio
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: need help with formula to compare columns and add vaule for matches

    my headers are in A1:D1

    data starts in A2

  5. #5
    Registered User
    Join Date
    02-04-2014
    Location
    ohio
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: need help with formula to compare columns and add vaule for matches

    sample.xlsx


    Here is a basic example of what I am trying to accomplish

  6. #6
    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,946

    Re: need help with formula to compare columns and add vaule for matches

    I put this in E2, copied down, but if you need it in D2, then put it there instead...
    =INDEX(C:C,MATCH(A2,B:B,0))

  7. #7
    Registered User
    Join Date
    02-04-2014
    Location
    ohio
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: need help with formula to compare columns and add vaule for matches

    hmmm.

    I tried copy into D2 and got #N/A error?

  8. #8
    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,946

    Re: need help with formula to compare columns and add vaule for matches

    see attached
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    02-04-2014
    Location
    ohio
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: need help with formula to compare columns and add vaule for matches

    actual.xlsx

    Would you please apply that formula to this file?? I am still having issues getting this to work. Thanks!!!!!!

  10. #10
    Registered User
    Join Date
    02-04-2014
    Location
    ohio
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: need help with formula to compare columns and add vaule for matches

    looking to have =INDEX(C:C,MATCH(A2,B:B,0)) applied to attached file "actual.xlxs" not sure why I cant get this to work in D2

  11. #11
    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,946

    Re: need help with formula to compare columns and add vaule for matches

    Its giving NA because you have no matches

  12. #12
    Registered User
    Join Date
    02-04-2014
    Location
    ohio
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: need help with formula to compare columns and add vaule for matches

    I did a find on value in column B3 and have a match (A82) so that should copy C3 to D3 in same row?

  13. #13
    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,946

    Re: need help with formula to compare columns and add vaule for matches

    They are not the same. A82 and a few trailing spaces at the end. To allow for that, change the formla to this...

    =MATCH(TRIM(A2),$B$2:$B$2708,0)

+ 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. Replies: 1
    Last Post: 09-26-2013, 12:16 PM
  2. Compare 2 other columns if first one matches
    By dclive in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-21-2011, 05:56 AM
  3. How to compare 6 columns and identify matches
    By KINNEY0201 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-02-2010, 08:40 PM
  4. Compare columns & remove matches
    By x1372 in forum Excel General
    Replies: 2
    Last Post: 08-14-2009, 09:35 AM
  5. [SOLVED] I need to compare to columns and indicate the matches in another
    By IFIXPCS in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 02-22-2006, 01:10 PM

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