+ Reply to Thread
Results 1 to 4 of 4

Assign a category to a cell based on two conditions

  1. #1
    Registered User
    Join Date
    03-09-2015
    Location
    Thailand
    MS-Off Ver
    2007
    Posts
    13

    Assign a category to a cell based on two conditions

    I have Worksheet 1 with individual animals (column A), from multiple batches (column B), each with a tag code (column C) that represents a family (column D). I need to fill in the family (column D). On a second worksheet, I have the tag codes that represent each family, by batch.
    Individuals in worksheet 1 should be assigned the family by looking up their batch and tag in Worksheet 2.

    Attached is an excerpt of the worksheets.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: Assign a category to a cell based on two conditions

    Try in D2:

    =LOOKUP(2,1/(('worksheet 2'!$A$2:$A$29='worksheet 1'!B2)*('worksheet 2'!$B$2:$B$29='worksheet 1'!C2)),'worksheet 2'!$C$2:$C$29)
    Quang PT

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,592

    Re: Assign a category to a cell based on two conditions

    Use this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-09-2015
    Location
    Thailand
    MS-Off Ver
    2007
    Posts
    13

    Re: Assign a category to a cell based on two conditions

    Thanks a lot bebo021999 and zbor for the quick responses. Both solutions seem to work. I'll take a closer look to understand how they worked.
    You saved me a lot of time and work...

+ 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: 15
    Last Post: 10-12-2014, 08:53 AM
  2. [SOLVED] How Do I Assign Attributes to Entries Based on Category?
    By kelman17 in forum Excel General
    Replies: 6
    Last Post: 06-10-2013, 09:31 PM
  3. [SOLVED] Assign Letter from list based on two conditions.
    By stockgoblin42 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-22-2013, 04:10 PM
  4. Check cell for word, If word exists in cell, assign that cell to corresponding category.
    By Trevasaurus in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2012, 12:35 PM
  5. Assign values based on conditions in excel
    By Maniraj in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-16-2012, 12:31 AM

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