+ Reply to Thread
Results 1 to 6 of 6

Simple pair matching using dynamic criteria

  1. #1
    Registered User
    Join Date
    08-03-2015
    Location
    Aarhus, Denmark
    MS-Off Ver
    Office 2013
    Posts
    4

    Simple pair matching using dynamic criteria

    Hi,

    I want to conduct simple pair matching in Excel.

    I have a group of companies (191) which have received a "treatment", and I want to match each company to exactly one other company from a larger group with 1286 companies.

    Each company should be matched on the following criteria in this order: 1-digit SIC code (ranges 0-9), sales in the range 70% to 130% (ranges 0-999999) of the treatment firm and the lowest book-to-market ratio (ranges 0.0 to 999). For both companies, these values are arranged in 3 separate columns, such that I have 3x191 and 3x1286.

    For each of the 191 entries, I would like to loop through the range of the first row that contains all matching SIC-codes, then within that range find all entries which are in the range of sales and then find the book-to-market ratio closest to the one of the treatment firm. The formula should return the value from the fourth column, which contains a unique identifier for the matched firm.
    Attached Files Attached Files
    Last edited by Frederik_S; 01-07-2018 at 06:28 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,381

    Re: Simple pair matching using dynamic criteria

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    08-03-2015
    Location
    Aarhus, Denmark
    MS-Off Ver
    Office 2013
    Posts
    4

    Re: Simple pair matching using dynamic criteria

    I have attached my worksheet in the original post.

    Column AJ to AL have the criteria, which are to be matched with the values in column A to C. The SIC-code should be an exact match and the difference in EBITDA/sales should be minimised while sales being within 70% to 130% of the value in column AK.

    When I wrote book-to-market before, I meant EBITDA/sales, sorry.

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

    Re: Simple pair matching using dynamic criteria

    Not that simple!!!

    An array formula, copied down:

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


    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...

    If copying the formula from the post (rather than from the attached sheet) remember to change , into ; to meet your regional settings.
    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

  5. #5
    Registered User
    Join Date
    08-03-2015
    Location
    Aarhus, Denmark
    MS-Off Ver
    Office 2013
    Posts
    4

    Re: Simple pair matching using dynamic criteria

    Hi,

    Thank you very much!

    Your help is greatly appreciated.

  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 2406
    Posts
    44,662

    Re: Simple pair matching using dynamic criteria

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. Find matching pair, auto-poulate missing data and transfer to another sheet
    By Saarang84 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 12-29-2016, 10:49 AM
  2. Using VBA, Pair Off and Delete matching totals which sum to 0
    By swade730 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-25-2016, 10:54 AM
  3. Matching with multiple criteria/dynamic range
    By Timgis in forum Excel General
    Replies: 3
    Last Post: 04-26-2015, 11:31 AM
  4. Pair columns and based on matching add a value from a third coumn
    By ertert00 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-11-2015, 07:49 AM
  5. Replies: 0
    Last Post: 10-11-2013, 05:24 AM
  6. Matching max in a subgroup with corresponding data pair
    By jconta@gmail.com in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-30-2006, 02:10 PM
  7. [SOLVED] Matching one pair of cells with another
    By Giselle in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-19-2006, 08:35 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