+ Reply to Thread
Results 1 to 3 of 3

Return a row value based on conditions

  1. #1
    Registered User
    Join Date
    03-14-2019
    Location
    Melbourne
    MS-Off Ver
    Office 2016
    Posts
    17

    Return a row value based on conditions

    HI All,

    I have been trying to get a formula working for the below scenario but couldn't succeed.

    There are 2 worksheets in my file. Sheet 1 has list of suburbs and Sheet 2 has list of same suburbs with a Unique ID for them.

    There is one to many relationship between suburbs from Sheet 1 and Sheet 2.

    For Example,
    Sheet 1 has Suburb = "Hanwood North" and Sheet 2 has same suburb with 4 rows and Unique ID for each row.
    I need to pick second row's Unique ID for the same suburb.

    Sheet 1 :

    Suburb
    Hanwood North

    Sheet 2:

    Suburb ID
    Hanwood North | S04-2ALZ-5106
    Hanwood North | S03-2ALZ-5106
    Hanwood North | S02-2ALZ-5106
    Hanwood North | S01-2ALZ-5106
    Attached Files Attached Files
    Last edited by roman22; 11-20-2019 at 10:47 PM.

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

    Re: Return a row value based on conditions

    So you want to get the 2nd match on the suburb? This means on sheet 1 of your attachment, next to Hanwood North you want "S02-2ALZ-5106" to display? If so, you can use this array formula in B2 and copy it down. (To enter an Array formula, click in the cell, paste the formula, and then instead of hitting Enter, hit Shift, Ctrl, Enter at the same time.

    =INDEX(Sheet2!B2:B7,SMALL(IF(Sheet2!A2:A7=A2,ROW(Sheet2!A2:A7)-ROW(INDEX(Sheet2!A2:A7,1,1))+1),2))

    If you do it right, the formula above will show with brackets around it ( {} ).

  3. #3
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Return a row value based on conditions

    Please try

    B2 on Sheet1
    Please Login or Register  to view this content.

    Regards.

    Note : For better performance, you may limited refered range of sheet2 by change ALL Column to Range ie.
    From Sheet2!$B:$B to Sheet2!$B$1:$B$10 and so on.
    Last edited by menem; 11-21-2019 at 12:11 AM. Reason: Add note

+ 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. [SOLVED] Return value based on the match & If conditions
    By santanuKD in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-15-2019, 10:29 AM
  2. Return Value Based on Two Conditions
    By JillC in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-12-2015, 06:01 PM
  3. Return value based on a number of conditions
    By scottwc in forum Excel General
    Replies: 12
    Last Post: 08-29-2014, 02:02 AM
  4. [SOLVED] Lookup and Return Value Based On 2 Conditions
    By PatrickDC in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-18-2013, 01:40 AM
  5. return count value based on several conditions
    By Arturas in forum Access Tables & Databases
    Replies: 3
    Last Post: 05-06-2012, 12:23 PM
  6. return value based on two conditions
    By sly424 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-07-2007, 01:43 PM
  7. [SOLVED] How do I return a value based on multiple possible conditions?
    By nevermore627 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-20-2006, 08:20 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