+ Reply to Thread
Results 1 to 5 of 5

Get row number where three columns contain specific values

  1. #1
    Registered User
    Join Date
    07-20-2011
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    15

    Get row number where three columns contain specific values

    I need to retrieve the row number to use in an ADDRESS function where the value in A is "L", the value in B is "1", and the value in C is "5" at the same time. I found this array formula that allows me to check two columns' values, but how do I get it to check a third and return the row number that contains all three?

    {=MATCH("L",IF(B2:B7="1",A2:A7),0))}

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Get row number where three columns contain specific values

    Try this...

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


    Quote the 1 & 5 withing double quotes if needed..

    ...confirmed by pressing CTRL-SHIFT-ENTER to activate the array. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL-SHIFT-ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    07-20-2011
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Get row number where three columns contain specific values

    I tried

    {=MATCH(1,('# A-B'!$D:$D=TEXT($A2,"?"))*('# A-B'!$E:$E=TEXT($B2,"?"))*('# A-B'!$F:$F="1"),0)}

    (entered as an array formula), but all I get is #N/A

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Get row number where three columns contain specific values

    It should work...

    Instead of TEXT($A2,"?") use Trim($A2) which will convert the number to text.

    Check whether you are having the same values in the referred range.

    Please don't use Array Formula for whole column instead restrict it for a range..

  5. #5
    Registered User
    Join Date
    07-20-2011
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Get row number where three columns contain specific values

    For some reason it doesn't work, even though I know that there is a row that fits the bill. I've moved on to trying VBA to create my own function that takes in 3 ranges and the respective values I want found in each of those ranges, then loops through each until all three are found. It then returns the row number where it found all three (if it didn't find anything, it returns -1). That's the idea, but my first pass at it isn't working (it reports back the row in which it found the first value in the first range). Because this function may be used quite a bit throughout my workbook, I'd like it to stop searching as soon as it finds the match. Here's my first pass:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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