+ Reply to Thread
Results 1 to 5 of 5

How to join two worksheets into one based on the data they contain

  1. #1
    Registered User
    Join Date
    10-22-2013
    Location
    Athens
    MS-Off Ver
    Excel 2003
    Posts
    3

    Exclamation How to join two worksheets into one based on the data they contain


    Hello to everyone!
    I would like some help on how to join two different worksheets that I receive every week.
    Sheet 1 contains information on the defects that were observed during a week (#defect, type of defect, #quality control) and Sheet 2 contains info on the corrective actions that need to be taken for these defects (#defect, corrective action, responsible person, date of completion).
    I want to unite these data and create a new worksheet (see Sheet joined data in the attached file) with the following columns: #defect, type of defect, #quality control, corrective action, respons. pers, date of completion.
    I tried with the VLOOKUP function but I face two problems:
    1.) When I tried to VLOOKUP the lookup value #defect(Defects worksheet) in the Corrective Action table array I miss some results because one defect can have more than one corrective actions
    2.) When I tried to VLOOKUP the lookupvalue #defect(Corrective actions worksheet) in the Defects table array I also miss some results because not every defect has a corrective action.

    I would appreciate any help

    Please note that the attached file was incomplete. I have now uploaded the corrected one
    Attached Files Attached Files
    Last edited by liaites; 10-22-2013 at 04:00 AM. Reason: the attached file was incomplete

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: How to join two worksheets into one based on the data they contain

    Are you really using Excel 2003? There are some functions that were only introduced for XL 2007, so we would have to avoid using those.

    Pete

  3. #3
    Registered User
    Join Date
    10-22-2013
    Location
    Athens
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: How to join two worksheets into one based on the data they contain

    Hello Pete,

    In my office computer I have only XL2003 installed, but if that hinders the solution to my problem I could relocate to another computer!

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: How to join two worksheets into one based on the data they contain

    No, that's okay. In the attached file I've done it a bit differently than what you asked for - put this formula in F2 of the Corrective Actions sheet:

    =IF(A2="","-",A2&"_"&COUNTIF(A$2:A2,A2))

    then copy down to beyond your data to ensure that you pick up all the data (the hyphens indicate how far you have copied it). Then in the Defects sheet you could put this in E2 (or indeed in D2 - I just left a blank column there):

    =IF(ISNA(MATCH($A2&"_1",'corrective actions'!$F:$F,0)),"",INDEX('corrective actions'!B:B,MATCH($A2&"_1",'corrective actions'!$F:$F,0)))

    This can then be copied into F2:G2, with appropriate headings in row 1. This will get the first corrective action for that defect number - very similar formula can be used to get the second and third corrective actions by just changing the _1 to _2 and _3 in the formula. Then that row of formulae can be copied down to complete your table.

    Hope this helps.

    Pete
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-22-2013
    Location
    Athens
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: How to join two worksheets into one based on the data they contain

    Pete thank you for your help!
    In my post I neglected to tell you that I have many more columns than those in the attached file. This means, that I cannot have the corrective actions side-by-side..
    I will consider this solution, though, if I will not come up with something else

+ 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: 2
    Last Post: 05-06-2013, 08:53 AM
  2. Full outer join of data across two workbooks based on a common column
    By godric7gt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2012, 02:23 AM
  3. Join data from two worksheets
    By 4joey1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2010, 03:00 PM
  4. Join 2 worksheets in a 3rd
    By leviathan185 in forum Excel General
    Replies: 7
    Last Post: 07-03-2009, 08:30 AM
  5. join worksheets from some files in new
    By eugz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-09-2008, 12:24 PM

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