Results 1 to 7 of 7

Fairly complex - matching "siblings" and "parents" across sheets

Threaded View

  1. #1
    Registered User
    Join Date
    12-01-2016
    Location
    Denmark
    MS-Off Ver
    Office 365 ProPlus
    Posts
    8

    Fairly complex - matching "siblings" and "parents" across sheets

    Hi all

    Tried to solve this problem using formulas which was manageable, but only by adding several helper columns and having a formula too complex for "normal" users to read and understand.
    So now I try to have it done with VBA instead.

    In short the task is to find pairs of "siblings" with the same parent. See enclosed workbook for illustration.

    Outcome
    Range with comments in sheet 1, column D

    Information
    Sheet 1 is the main sheet. This is where the matching should be done
    Sheet 2 contains all siblings. This sheet is used for identifying siblings

    Criteria
    • Column A in sheet 1 should contain more than one entry of the Top Item ID. E.g. 6083966 has 9 entries. If only one entry the function should return a comment e.g. "6083977 only one entry". (Highlighted in blue)
    • If more than one entry in column A sheet 1, next step is to check if the Item ID in column B. If the Item ID has duplicates in either column A or B in sheet 2, the function should return a comment "Multiple entries in Sheet 2" (Highlighted in orange)
    • If there is only one entry in either column A or B in sheet 2, the function should match the related sibling. E.g. Item ID 6023864 has a sibling in sheet 2, 6179298. This goes both ways so that for Item ID 6179298 the function should return sibling 6023864 (Highlighted in Yellow)
    • A pair of siblings should always have the same parent. E.g siblings 6023864 & 6179298 has the parent 6083966 = OK. But there is also a pair of siblings with different parents = Not OK (highlighted in red)
    • If a pair of siblings have the same parent last step is to check if the pair of siblings have both texts "Only Eng" & "Only Supp". If not = Not OK (highlighted in grey)
    • Examples of successful matches are highlighted in green.

    My biggest problem so far with this problem is speed and ensuring all criteria is met. Main sheet 1 can contain anywhere from 2000 rows up to 20000 rows to be checked. Sheet 2 contains anywhere from 2000 rows up to 6000 rows.
    I am thinking populating the ranges in arrays and doing the comparing there would be the fastest approach.

    Looking forward to hearing from you.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 02-05-2019, 12:03 AM
  2. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  3. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  4. Replies: 2
    Last Post: 06-06-2013, 12:45 PM
  5. "The "sheets" method from the "_Global" object have failed."
    By mankit87 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-08-2011, 08:53 AM
  6. Replies: 7
    Last Post: 05-13-2006, 05:02 PM
  7. Replies: 1
    Last Post: 01-30-2006, 06:10 PM

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