+ Reply to Thread
Results 1 to 5 of 5

Compare columns and replace values?

  1. #1
    Registered User
    Join Date
    06-28-2010
    Location
    New Jersey
    MS-Off Ver
    Excel 2003
    Posts
    3

    Compare columns and replace values?

    Hello all,

    I am new to this site and excel and hope you can help me in what I'm trying to achieve.

    Basically, I have two worksheets.

    Worksheet #1 contains a CEP and UF_ column. CEP is the zip code for Brazil cities and UF_ is the state abbreviation.

    Worksheet #2 contains a CEP and UF_ column as well.

    Worksheet #1 contains the correct CEP matched with the correct UF_.

    What must I do to have the CEP in Worksheet #2 search and match the CEP in Worksheet #1, and if there is a match, the UF_ field in Worksheet #2 will be updated with the value of the UF_ field in Worksheet #1?

    Example file attached.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    08-29-2007
    Posts
    47

    Re: Compare columns and replace values?

    Sounds like a simple VLOOKUP to me. Use the Excel Help for more information, but basically, you put the formula in Worksheet2 in the UF_ column. The lookup value would be the CEP cell in that row. The lookup table would be in Worksheet1, make sure to lock in the cell references with $s.

  3. #3
    Registered User
    Join Date
    06-28-2010
    Location
    New Jersey
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Compare columns and replace values?

    Thanks. Would you be able to show me an example in the spreadsheet I attached?

  4. #4
    Registered User
    Join Date
    08-29-2007
    Posts
    47

    Re: Compare columns and replace values?

    Attached. I left the formula in there so you can see how it works. You can copy everything and Paste as Values when you're ready to use it. Just do a Find/Replace for #N/A to get rid of those, and you're left with only UFs that matched a CEP in the first worksheet.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-28-2010
    Location
    New Jersey
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Compare columns and replace values?

    What do you mean copy everything and paste as values? Copy and paste what where?

    Thanks in advance.

+ 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