+ Reply to Thread
Results 1 to 6 of 6

Populate column if cell's text matches cell in another sheet

  1. #1
    Registered User
    Join Date
    10-14-2013
    Location
    Norway
    MS-Off Ver
    Excel 2010
    Posts
    4

    Populate column if cell's text matches cell in another sheet

    Hello!

    I recently got a new job, and one of my tasks is to assign a big amount of suppliers into categories. For example "Company Inc." supplies cars, and I want to only type once that "Company Inc." supplies us with cars. Another company, say "Work Co." supplies parts, and I want to only fill in once that "Work Co." supplies us with parts. And so on. There's several workbooks with several hundred suppliers, but they all belong in 1 of 7 categories ("Cars", "Parts", and so on).

    I have attached an example of how one of the workbook looks like. I have manually filled in one of the sheets with category data. The next sheet is another region, and I wonder if there's a formula that can make my work easier? If one of the companies in the sheet called "Target Sheet" matches one of the companies in "Data Source", I want the category column to fill in the correct category based on the sheet which is already categorized. For example, "Random company" exists in both sheets. Is there a formula that can check that "Random company" exists in the "Data Source" sheet, and input the adjacent category into the category column in the "Target Sheet" sheet?

    I hope you can help me out, and that my explanation is sufficient.
    Attached Files Attached Files

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Populate column if cell's text matches cell in another sheet

    welcome to the forum, Rela. in C2 of Target Sheet:
    =IFERROR(VLOOKUP(B2,'Data Source'!$B$2:$C$21,2,0),"")

    at least that's what i think you're looking for. that is to look for B2 (Asdg) inside B2:B21 of Data Source sheet. when it finds an exact match, return the 2nd column; C2:C21. the 2 inside the formula implies 2nd column, and the 0 implies exact match

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Valued Forum Contributor TheCman81's Avatar
    Join Date
    11-06-2012
    Location
    Edinburgh, UK
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    346

    Re: Populate column if cell's text matches cell in another sheet

    Do you mean like this

    =VLOOKUP(B2,'Data Source'!B2:$C$21,2,0)

    Put the above formula in your Target Sheet
    Excel Guru in the making

    <----------If the question has been answered to your satisfication please click the Add Repuation star to the left

  4. #4
    Registered User
    Join Date
    10-14-2013
    Location
    Norway
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Populate column if cell's text matches cell in another sheet

    Thank you for quick answers both of you. However, when I try out both benishiryo and TheCman81's formulas I get error messages saying the formula contains an error on both. I am by no means an expert Excel user, and I can't seem to figure out exactly what is wrong with the formulas. I have the 2010 version of Excel, if that matters at all.

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Populate column if cell's text matches cell in another sheet

    You might have to use semi-colons as the argument separator instead of commas:

    =IFERROR(VLOOKUP(B2;'Data Source'!$B$2:$C$21;2;0);"")

    =VLOOKUP(B2;'Data Source'!B2:$C$21;2;0)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Registered User
    Join Date
    10-14-2013
    Location
    Norway
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Populate column if cell's text matches cell in another sheet

    Thank you Tony! Guess I should have been able to figure that one out on my own... benishiryo's formula works perfectly, gives me blank cells when there is no match. TheCman81, yours give me a #N/A when there is no match, but works exactly the same otherwise. Thank you all!

    A follow-up question: Is it possible to have the same formula check several sheets for a match? In that case, what happens if there's a match in two or tree sheets?

+ 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. Have a cell automatically populate with a name if a cell matches another cell
    By rogerwphillips in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-29-2013, 09:14 PM
  2. [SOLVED] If cell value in one column matches text, fill cell value in different column on same row
    By zigojacko in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-17-2013, 05:21 AM
  3. Replies: 1
    Last Post: 08-02-2012, 11:39 PM
  4. Replies: 1
    Last Post: 10-30-2009, 10:58 AM
  5. Replies: 3
    Last Post: 07-02-2008, 10:15 AM

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