+ Reply to Thread
Results 1 to 9 of 9

Match two cells composed of text in the same row

  1. #1
    Registered User
    Join Date
    03-23-2009
    Location
    Los Angeles
    MS-Off Ver
    Excel 2003
    Posts
    4

    Unhappy Match two cells composed of text in the same row

    I have 570 records in one sheet and 330 on the other one. They are the same data and I want to match them but i have been doing so manually because in the one w/ 330 there are missing values, so I have been copying and pasting but takes too long. The 570 is complete, i took it from the census data and the 330 is not.

    I want to be able to match them in the same row including missing values so I can use it in ArcGIS

    I have tried to match w/ the match function but have not had luck...

    see if anyone could help... I would appreciate
    Last edited by teckolote19; 04-09-2009 at 07:02 PM.

  2. #2
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Match two cells composed of text in the same row

    Give the VLOOKUP function a try, but in case that doesn't work, can you post a sample workbook?
    Last edited by ConneXionLost; 03-23-2009 at 02:42 AM.
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Match two cells composed of text in the same row

    INDEX/MATCH is the most robust and the fastest worksheet function for this task.

    =INDEX(RangeToReturnAValueFrom,Match(Value,RangetoMatchValueTo,FALSE))
    =INDEX(Sheet1!B:B,MATCH(Sheet2!$A2,Sheet1!$A:$A,0))

    Look at MATCH first...$A2 on the current sheet is spotted on the other sheet in column A. When it is found, the position of that match is returned to the INDEX as a positional reference and the item in the exact same position in column B (the "indexed" column) is the final result.

    You should make sure you can do all that on ONE sheet in a simple formula before complicating it (making it harder to read) by adding Sheet and Workbook references.

    If this is really that hard, blow off the sample and post a REAL sanitized excerpt from your ACTUAL sheets with correct sheetnames/workbook names and everything.
    Attached Files Attached Files
    Last edited by JBeaucaire; 04-08-2009 at 07:13 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    03-23-2009
    Location
    Los Angeles
    MS-Off Ver
    Excel 2003
    Posts
    4

    Unhappy Re: Match two cells composed of text in the same row

    I have tried following JBeaucaire's advice and I have not been able to make it work. I have posted a sample wordbook The first sheet has the reference data where I want to add sheet2' (data to match) data. You can see the end result in sheet3 (end result).

    Thanks for the help
    Attached Files Attached Files

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Match two cells composed of text in the same row

    It's not going to work. Your data doesn't have common columnar values. One sheet is in standard US alphabetic characters (though all caps, but we could get around that), and the other is longer column of longer strings with Mexican alphabet.

    We could strip off the first 12 characters and the remaining data still doesn't match. Maybe someone else can suggest a way to easily convert your mexican text strings into american, or vice versa. Right now, there's nothing to match.

  6. #6
    Registered User
    Join Date
    03-23-2009
    Location
    Los Angeles
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Match two cells composed of text in the same row

    ok, I have posted a different example and have cleaned the data.
    How does this look?
    Attached Files Attached Files

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Match two cells composed of text in the same row

    There is nothing to "bring over" from the reference sheet on your updated sheet. You had 570 rows laid out like this originally:
    Please Login or Register  to view this content.
    ...and now you just have 218 rows of:
    Please Login or Register  to view this content.
    There's nothing there to "retrieve" since these are the exact same words in the second sheet.

    Once you DO get your reference data cleaned up so that there is matching names AND data to retrieve, are you SURE you don't want to just try and applying the formula I gave you? It's going to be the exact formula with the columns updated...

  8. #8
    Registered User
    Join Date
    03-23-2009
    Location
    Los Angeles
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Match two cells composed of text in the same row

    I apologize maybe I did not make myself clear. I am trying to bring over data from the second tab into the first one. I want to match clean_muni_name2 to mun_name in the first page to bring all the data the second tab(data to match) contains. am I being clear?
    Thanks a lot for the help.

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Match two cells composed of text in the same row

    You're using Excel, so I have to assume you can look at two formula and see how they are related. In post #3 I gave you the syntax for bringing data from one sheet to another matching a piece of information.

    =INDEX(RangeToReturnAValueFrom,Match(Value,RangetoMatchValueTo,FALSE))[/color]
    =INDEX(Sheet1!B:B,MATCH(Sheet2!$A2,Sheet1!$A:$A,0))

    Can't you compare that formula to your sheet and work out the columns to use?

    The first piece in red is the data to bring over. The first piece you want is the TOT column, right? So that's Sheet "data to match" column C.

    Then the item to match first is in cell A2 on "reference" and you want to match that to the column B on "data to match", right? So you just substitute all those pieces in the example formula I gave.

    =INDEX('data to match'!C:C,MATCH('reference data'!$A2,'data to match'!$B:$B,0))

    Once that first formula is in B2, copy it down. Then make an adjustment to the first section only to create the INDEX for the next piece you want, column D. In fact, you can probably just copy that formula over to the right and it will adjust to the next column.

+ 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