+ Reply to Thread
Results 1 to 16 of 16

2 Sheets data combined into output sheet with match 1 field common

  1. #1
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    2 Sheets data combined into output sheet with match 1 field common

    Hi Experts:
    I have 2 excel tabs. They have similar data. In both tabs there is a reference number. I want to merge data from both tabs into tabOutput so that data from both tabs is matched with the reference number.

    Therefore I want that in the merged tab there is 1 row with combined data from sheet A + data from sheet B.

    This will be a live document. Every week we will add new rows to the tab A and B. So the formula has to be set up this way that the merged tab Output will refresh each time we add new data.

    Thanks in Advance.
    gul
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,855

    Re: 2 Sheets data combined into output sheet with match 1 field common

    Using Power Query, I merged the two tabs with an Inner Join based upon the Reference Column. Here is the Mcode for each file and then the Merge.

    Tab A required Trim and Clean of Reference first

    Please Login or Register  to view this content.
    Tab B required Trim and Clean of Reference to Match Tab A
    Please Login or Register  to view this content.
    Once cleaned, they were merged

    Please Login or Register  to view this content.
    The worksheet is attached for your review. When you add new rows to each of the Tabs then click on Refresh in the Data Tab. You may be required to do that twice, once to update the query and second to download the updated information.
    Attached Files Attached Files
    Last edited by alansidman; 05-18-2019 at 12:08 PM.
    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

  3. #3
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: 2 Sheets data combined into output sheet with match 1 field common

    not working for me

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,855

    Re: 2 Sheets data combined into output sheet with match 1 field common

    What does "Not Working" Mean. Not a very helpful response. It appears in my worksheet as you have requested. Look at the links in my signature for understanding Power Query and how to replicate my solution. Error messages received? Different Results? Help us to help you. Cannot see your screen and flunked Mind Reading in University.

  5. #5
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: 2 Sheets data combined into output sheet with match 1 field common

    I need formula or any VBA script for this.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: 2 Sheets data combined into output sheet with match 1 field common

    In N3, an array formula to return a clean reference number:
    =IFERROR(LOOKUP("zzzzz",INDEX(TRIM(SUBSTITUTE(A!$A$2:$A$4,CHAR(9),"")),MATCH(0,COUNTIF(N$2:N2,TRIM(SUBSTITUTE(A!$A$2:$A$4,CHAR(9),"")))+IF(IF(COUNTIF(B!$N$2:$N$5,TRIM(SUBSTITUTE(A!$A$2:$A$4,CHAR(9),"")))>0,1,0)=1,0,1),0))),"")

    In A3, copied across and down:
    =IFERROR(INDEX(B!A$2:A$5,MATCH(Output!$N3,B!$N$2:$N$5,0)),"")

    In O3, copied down:
    =IFERROR(INDEX(B!O$2:O$5,MATCH(Output!$N3,B!$N$2:$N$5,0)),"")

    In P3, anther array formula, copied across and down:
    =IFERROR(INDEX(A!B$2:B$4,MATCH(Output!$N3,TRIM(SUBSTITUTE(A!$A$2:$A$4,CHAR(9),"")),0)),"")

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...

    It would be simpler, if a helper column on A was acceptable, as the reference code is preceeded by a tab and a space and followed by several spaces
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  7. #7
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: 2 Sheets data combined into output sheet with match 1 field common

    Error is showing
    Attached Images Attached Images

  8. #8
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: 2 Sheets data combined into output sheet with match 1 field common

    Hi Glenn Kenedy,
    can you put formula on this file? I have tried on merged sheet but not working.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: 2 Sheets data combined into output sheet with match 1 field common

    any expert can help?

  10. #10
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,855

    Re: 2 Sheets data combined into output sheet with match 1 field common

    If you are running Office 2010 or later (your profile says 2007), then Power Query has provided exactly what you asked for. Don't be afraid to try new Excel features. You may be surprised as to how easy it is to get your solution.

  11. #11
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: 2 Sheets data combined into output sheet with match 1 field common

    I'm using 2007

  12. #12
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: 2 Sheets data combined into output sheet with match 1 field common

    Glenn Kennedy formula is working, but when I putting on my sheet it is not working,

  13. #13
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: 2 Sheets data combined into output sheet with match 1 field common

    Glenn Kennedy are you there?

  14. #14
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,855

    Re: 2 Sheets data combined into output sheet with match 1 field common

    @farhangul

    We are all volunteers. This is a world wide forum and while you may be at work, others may be sleeping or involved with other family or business matters. If your issue is of an urgent nature, you may wish to contact a local professional and pay for their services. This forum is free and you must be patient as people volunteer their time as it is available. Do not bump your thread more than once every 24 hours as it is clutter and does not do you or anyone else any benefit.

    Additionally, there is a pay for service sub-forum here called Commercial Services where someone may be willing to assist for payment.

  15. #15
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: 2 Sheets data combined into output sheet with match 1 field common

    Thanks for your reply, I'm talking about who can help, I'm not hurry, I know this is world wide forum, Thanks for information.

  16. #16
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: 2 Sheets data combined into output sheet with match 1 field common

    Hi,
    Merged sheet is not updated automatically.

+ 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. [SOLVED] connecting two sheets based on a common field
    By nshatz in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-16-2015, 10:40 AM
  2. Combining data from 2 sheets that have a common field
    By bridget2014 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-08-2014, 06:50 PM
  3. Compare two sheets of Data and output Variance on New Sheet
    By artikyulashun in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-07-2012, 01:51 AM
  4. linking up two seperate sheets via common field name
    By Rambergs in forum Excel General
    Replies: 2
    Last Post: 02-24-2012, 03:02 PM
  5. Consolidate opposite pairs with data into one common pair with combined data
    By cpbrock3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-29-2011, 12:00 PM
  6. Importing several Output sheets into one consolidated Output Sheet
    By Ugh_Der in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-13-2009, 08:58 AM
  7. Replies: 0
    Last Post: 01-29-2009, 08:59 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