+ Reply to Thread
Results 1 to 5 of 5

Search Unsorted

  1. #1
    Registered User
    Join Date
    05-31-2017
    Location
    Toronto, Ontario
    MS-Off Ver
    2007
    Posts
    2

    Search Unsorted

    I am trying to search an unsorted list for the next value that satisfies a certain condition, but am having trouble doing so.

    5/26/1977 983.43 27.4081
    5/27/1977 979.36 25.0085
    5/30/1977 980.31 26.6233
    5/31/1977 981.19 28.1664
    6/1/1977 982.66 30.7849
    6/2/1977 981.24 29.6602
    6/3/1977 986.45 38.5336
    6/6/1977 983.85 36.087
    6/7/1977 984.98 37.9315

    To start i have 5/26/1977. I want to then search for the next time that the third column is over 30, and display that date in another cell (i.e. this would then display 6/1/1977).

    Any help much appreciated.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Search Unsorted

    Assuming conditions are in F2 (5/26/1977) & G2 (30).
    Data in A2:C10 range.

    =INDEX($A$2:$A$10,MATCH(1,($A$2:$A$10>F2)*($C$2:$C$10>G2),0))
    Confirmed as array (CTRL + SHIFT + ENTER)

    See attached.

    Edit: If date column is unsorted, it will be bit more complex. Since you had date column sorted. I assumed you meant unsorted on column C.

    Edit2: If date column is unsorted, you can use below.
    =MIN(IF(($A$2:$A$10>F2)*($C$2:$C$10>G2)*(A2:A10),A2:A10))
    Confirmed as array (CTRL + SHIFT + ENTER)
    Attached Files Attached Files
    Last edited by CK76; 05-31-2017 at 09:17 AM. Reason: See Edit & Edit2
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

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

    Re: Search Unsorted

    Perhaps this VBA solution
    Please Login or Register  to view this content.

    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button
    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

  4. #4
    Registered User
    Join Date
    05-31-2017
    Location
    Toronto, Ontario
    MS-Off Ver
    2007
    Posts
    2

    Re: Search Unsorted

    Thank you both. Got it working

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

    Re: Search Unsorted

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

+ 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. Offset match search for unsorted data
    By KampKounslr in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 03-06-2015, 09:01 PM
  2. Replies: 11
    Last Post: 02-20-2015, 09:29 AM
  3. Using lookup when unsorted
    By Tuneman in forum Excel General
    Replies: 3
    Last Post: 01-29-2010, 01:19 PM
  4. search and match an unsorted list
    By Venka in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-14-2008, 03:11 AM
  5. [SOLVED] lookup unsorted list
    By sslenterprises in forum Excel General
    Replies: 2
    Last Post: 10-25-2005, 05:05 AM
  6. An unsorted list in vlookup
    By Traima in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  7. [SOLVED] An unsorted list in vlookup
    By Traima in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 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