+ Reply to Thread
Results 1 to 5 of 5

Populate cells with data from other cells if 2 matches are true

  1. #1
    Registered User
    Join Date
    11-29-2013
    Location
    Pattaya, Thailand
    MS-Off Ver
    Excel 2013
    Posts
    71

    Question Populate cells with data from other cells if 2 matches are true

    Hello,

    I'm trying to auto-fill cells with data from another sheet when 2 criteria are true. If both criteria can't be met, then only the first match is true and can be filled.
    Since this data is collected in 6 columns side by side, I use Iferror, if, index & match to search the column-range, match the entered value(s) and return those values if true or repeat the same formula in the next set of columns if false. The IFERROR is supposed to return the first single match if not all criteria can be met.

    The formula works fine, but fills the wrong data if a match from another range can be made.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I've attached a working sample and highlighted where the problem occurs with some explanation. The formula is not as complicated as it seems because the formula just repeats for every range in the sheet. Any help would be highly appreciated.Display matching names.xlsx

  2. #2
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Populate cells with data from other cells if 2 matches are true

    I have taken a "stab" at this by using a helper column that I have labelled Unit (column D) and renamed Unit to Value in Row.

    In the UNIT column starting in D14 (I placed my work under your original) I entered this formula to identify the Unit in row 1 of the Unit worksheet.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    In the Name column starting in E14 I entered this formula to return the name that corresponds to the ID and Unit where both exist and if there isn't a match for the ID and Value in the row.

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


    This is the result:
    A
    B
    C
    D
    E
    13
    day
    ID
    Value in Row
    Unit
    Name
    14
    1
    CJ
    15
    1
    999
    Unit2
    test
    16
    3
    999
    Sammy
    17
    18
    19
    3
    Sammy
    20
    3
    202
    Unit2
    Mick
    21
    3
    303
    Unit8
    Piero


    This is such a small sample of data that I don't know what will happen when the chart on the UNIT worksheet is completed.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  3. #3
    Registered User
    Join Date
    11-29-2013
    Location
    Pattaya, Thailand
    MS-Off Ver
    Excel 2013
    Posts
    71

    Re: Populate cells with data from other cells if 2 matches are true

    Thank you,

    I'll have a look tonight and see if this does the trick. I hadn't thought of using helper columns before, but if I do, I can simply break it down per column. I'll use your example to accomplish this.

  4. #4
    Registered User
    Join Date
    11-29-2013
    Location
    Pattaya, Thailand
    MS-Off Ver
    Excel 2013
    Posts
    71

    Re: Populate cells with data from other cells if 2 matches are true

    Dear Mr. Doverman,

    I ended up going a different route which works exactly as I wanted, and without any helper columns. Because we're all here to learn and share ideas, I thought you might find it interesting to see the solution I came up with as well. I used this array formula:

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


    and added an iferror to repeat matching both cells in the next set of columns as such:

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


    What it does is this:

    Lookup value from cell 1 and 2 and match in columns A and B, if both match, then return corresponding value from column C, if they don't match, then lookup value from cell 1 and 2 in columns D and E, and if both match , then return corresponding value from column F etc.

    If only value from cell 1 matches and cell 2 is empty, then the first corresponding value from column A is returned.

    Thanks again for your help and I hope this is of any use for future reference to you.

  5. #5
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Populate cells with data from other cells if 2 matches are true

    Congratulations on finding a solution that works for you.

+ 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-29-2014, 12:59 AM
  2. [SOLVED] lookup a range of cells and populate specific cells based on matching data
    By RobertM01 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-23-2014, 08:18 PM
  3. [SOLVED] Auto populate cells depending on data in other cells
    By Drunknmonkie in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-06-2013, 11:46 PM
  4. Replies: 5
    Last Post: 10-15-2012, 06:33 PM
  5. [SOLVED] Need formula to find matches, then populate other cells
    By damobilebrood in forum Excel General
    Replies: 4
    Last Post: 09-05-2012, 08:38 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