+ Reply to Thread
Results 1 to 2 of 2

Make two sets of columns match.

Hybrid View

  1. #1
    Registered User
    Join Date
    02-28-2013
    Location
    The Hills, Arkansas
    MS-Off Ver
    Excel 2016
    Posts
    69

    Make two sets of columns match.

    I thought I'd ask to see if it was even possible to do this before I start looking it up.

    I have 3 worksheets. Two are for reports and the third is there to compare select data from each one.


    What I'm trying to do is make Cell G1 match Cell A1 and if so does then check to see if cell H1 matches B1, and if they do
    import the cell values from "Report2" to the appropriate locations on the "Main" worksheet.

    If G1&H1 matches A1&B1 place values into J1&K1, if not check G2&H2 and see if A1&B1 matches G2&H2.
    If they do, import values from A1&B1 into J2,K2.
    Rinse and repeat.
    Along with this I also would like cell C1 to be imported into "Main K1" if the prior cells match. K1 does not need to match I1.


    Example

    Main 
    G1	H1	I1
    101	A	XXX
    102	B	XXX
    103	C	XXX
    104	D	XXX
    
    
    Report2
    A1	B1	C1
    101	A	XXX
    102	B	XXX
    104	D	XXX
    
    
    Final
    
    Main
    G1	H1	I1	J1	K1	L1
    101	A	XXX	101	A	XXX
    102	B	XXX	102	B	XXX
    103	C	XXX
    104	D	XXX	104	D	XXX


    Hopefully I haven't butchered my explanation of this to much.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,754

    Re: Make two sets of columns match.

    In J1: =IFERROR(IF(AND(VLOOKUP(G1,Report2!$A$1:$C$3,1,FALSE)=G1,VLOOKUP(Main!H1,Report2!$B$1:$C$3,1,FALSE)=H1),Main!G1,""),"") and copy down
    In K1: =IFERROR(IF(AND(VLOOKUP(G1,Report2!$A$1:$C$3,1,FALSE)=G1,VLOOKUP(Main!H1,Report2!$B$1:$C$3,1,FALSE)=H1),Main!H1,""),"") and copy down
    In L1: =IF(AND(G1=J1,H1=K1),Report2!C1,"") and copy down
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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