+ Reply to Thread
Results 1 to 11 of 11

Test many records against many conditions that are in other records

  1. #1
    Registered User
    Join Date
    10-17-2023
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Office 365
    Posts
    7

    Test many records against many conditions that are in other records

    I have 2 worksheets with dates. The first dataset describes 100 different categories with fields such as length (from and to), width (from and to), height (from and to), weight (from and to), color and material.

    The 2nd dataset describes objects with properties as they appear in the categories in the first dataset.
    Which formula should I use to investigate for each record in the 2nd dataset (the objects) in which category from the first dataset this object falls?
    Last edited by LaFormula; 10-17-2023 at 10:58 PM. Reason: adding file

  2. #2
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,842

    Re: Test many records against many conditions that are in other records

    This would be much better/easier if you would attach a sample workbook. It should include mocked up expected results. Please read the yellow banner at the top of the page.
    My guess though, is that maybe the XLOOKUP formula might do what you want.

  3. #3
    Registered User
    Join Date
    10-17-2023
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Office 365
    Posts
    7

    Re: Test many records against many conditions that are in other records

    Thanx Greg, I added a file!

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Test many records against many conditions that are in other records

    LaFormula I understand that your other thread is in Dutch, but you are only allowed 1 thread per question. Seeing as this seems to be progressing, I will close your other thread, you may continue here.
    https://www.excelforum.com/non-engli...e-records.html
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Test many records against many conditions that are in other records

    Here are 2 different solutions:

    Please try in O5 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    or everthing in one go, please empty all expected results and try in O5 (no copy down needed):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,842

    Re: Test many records against many conditions that are in other records

    And just another way to look at it:

    =FILTER($A$5:$A$24,($F$5:$F$24=$M6)*($G$5:$G$24=$N6)*($K6>=$B$5:$B$24)*($K6<=$C$5:$C$24)*($L6>=$D$5:$D$24)*($L6<=$E$5:$E$24),"")

  7. #7
    Registered User
    Join Date
    10-17-2023
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Office 365
    Posts
    7

    Re: Test many records against many conditions that are in other records

    Thanx a lot HD and Greg... I will give it a try today with my working file!!

  8. #8
    Registered User
    Join Date
    10-17-2023
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Office 365
    Posts
    7

    Re: Test many records against many conditions that are in other records

    So my first test is going wrong already. What am I missing here?
    I am testing only 1 condition (name in column B against names in column H) and the formula in column H returns nothing found.
    Please see attachment.
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,842

    Re: Test many records against many conditions that are in other records

    With that formula, you can change the 1 to TRUE, or put a double unary in front like:

    =XLOOKUP(TRUE,(B2=H$2:H$20),G$2:G$20,"-")
    =XLOOKUP(1,--(B2=H$2:H$20),G$2:G$20,"-")

    (Note: this is because you are only using one comparison, the compare brings back TRUE or FALSE. Once you multiply it (doing more than one comparison) it changes true false to 1 and 0)
    Last edited by Gregb11; 10-21-2023 at 03:29 PM.

  10. #10
    Registered User
    Join Date
    10-17-2023
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Office 365
    Posts
    7

    Re: Test many records against many conditions that are in other records

    In my real file I use more than one comparison. I deleted them one by one to find my error.
    But the formula only returns "-"

  11. #11
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,842

    Re: Test many records against many conditions that are in other records

    I'm confused. Are you still saying there's an issue? In Post #9 I told you what formula to use if you are only using 1 comparison. If you are using multiple comparisons, you can use the formula given in Post#5 (or post #6)

+ 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: 5
    Last Post: 04-13-2020, 07:41 AM
  2. Find the initial parent record based on the records in the last child records
    By Journeyman3000 in forum Access Tables & Databases
    Replies: 0
    Last Post: 03-30-2017, 08:46 PM
  3. Pulling records matching two criteria and inserting those records into an existing list
    By desertfx41 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-14-2014, 02:00 PM
  4. [SOLVED] VBA to rearrange 11000 records into 550 rows (20 records combined into a single row)
    By Wedge120 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-27-2014, 11:56 PM
  5. [SOLVED] need to be able to update records with button click and delete records sample included
    By unreal11 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-25-2013, 11:45 PM
  6. [SOLVED] Test to check if ODBC refresh has created new records
    By agricolan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-20-2012, 06:17 AM
  7. Replies: 5
    Last Post: 04-05-2012, 01:29 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