+ Reply to Thread
Results 1 to 4 of 4

Return row or column of a cell within a range

  1. #1
    Forum Contributor
    Join Date
    02-24-2010
    Location
    BC, Canada
    MS-Off Ver
    Excel 2010
    Posts
    174

    Return row or column of a cell within a range

    With the list that I generate (from another thread), I now need to search for the result in the original data and return the column and row separately. (I need to nest this in some larger formulas which I already have figured out.) I attached a simple example with highlights. Basically, search for B2 in Data!$B$8:$AF$29 and return the column it is found in. The extra tricky part is that if there is more than one occurence in column B then it searches for the next occurence of that number. On the example sheet 165.65 occurs twice (which I highlighted), so the first search would give the row/column for the first occurence and the second formula would figure out it is the second one and return the row/column of the second occurence in the data range.

    I've tried combinations of CELL, MATCH, ADDRESS etc but to no avail.

    Thanks.
    Attached Files Attached Files
    Last edited by The Phil; 03-22-2010 at 05:04 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Return row or column of a cell within a range

    Why not just reverse the logic and use the second approach illustrated on your prior thread... that is to say return the "address" in A and use that value to determine values to be retrieved.
    The values returned in A2 onwards represent the various positions of each value within the grid (COLUMN.ROW)

  3. #3
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Return row or column of a cell within a range

    Actually don't know what u did in your prior thread but to find rownum u can use this function

    =SMALL(IF(B68=Data!$B$8:$AF$29,ROW(Data!$B$8:$AF$29)),COUNTIF($B$2:B68,B68))

    To Find ColNum this one
    =SMALL(IF(B2=Data!$B$8:$AF$29,COLUMN(Data!$B$8:$AF$29)),COUNTIF($B$2:B2,B2))

    Both are confirmed with ctrl+shift+enter and copied down as far as needed...
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  4. #4
    Forum Contributor
    Join Date
    02-24-2010
    Location
    BC, Canada
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: Return row or column of a cell within a range

    Thanks guys, got it working just like I needed!!!

+ 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