Re: How to return cell reference

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Well.....these array formulas seem to work fine (so far) with duplicate
values, but they ain't too pretty:

First instance of "John" in A1:M10
Q1:
=ADDRESS(MIN(IF(A1:M10="john",ROW(A1:M10))),MIN(IF(OFFSET(A1:M10,MIN(IF(A1:M10="john",ROW(A1:M10)))-1,,1)="John",COLUMN(OFFSET(A1:M10,MIN(IF(A1:M10="john",ROW(A1:M10)))-1,,1)))))

Last instance of "John" in A1:M10
Q2:
=ADDRESS(MAX(IF(A1:M10="john",ROW(A1:M10))),MAX(IF(OFFSET(A1:M10,MAX(IF(A1:M10="john",ROW(A1:M10)))-1,,1)="John",COLUMN(OFFSET(A1:M10,MAX(IF(A1:M10="john",ROW(A1:M10)))-1,,1)))))

In both formulas, after the ROW reference is established, the COL ref
formulas are restricted to that one row.

***********
Regards,
Ron

XL2002, WinXP


"Ron Coderre" wrote:

Hmmm....It seems the formulas are at the mercy of the way Excel iterates
through the ranges. If the dupes are in the same column or staggered to the
right and/or down, the correct values are returned. Otherwise, wrong returns:

With Dupe Cells: C3 and A6
WRONG returned value of 1st instance: A3
WRONG returned value of last instance: C6

With Dupe Cells: C3 and F5
Correct returned value of 1st instance: C3
Correct returned value of last instance: F5

***********
Regards,
Ron

XL2002, WinXP


"Dave Peterson" wrote:

I put John in A3 and B1
and it returned A1 as the address.

This formula works for items that aren't duplicated.

(I don't have a solution if the data contains duplicates.)

Peo Sjoblom wrote:

Another way albeit array entered

=ADDRESS(MAX((A1:M10="john")*(ROW(A1:M10))),MAX((A1:M10="john")*(COLUMN(A1:M10))))

--

Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
"It is a good thing to follow the first law of holes;
if you are in one stop digging." Lord Healey

"Ron Coderre" <ronREMOVETHIScoderre@xxxxxxxxxxx> wrote in message
news:B33E7463-FB3D-42CD-A63B-B24D73DB9BF5@xxxxxxxxxxxxxxxx
See if one of these approaches helps.

If the Name will only be in Col_C:
=CELL("address",INDEX(C:C,MATCH("John",C:C,0)))

If the Name will be in A1:M10, but only ONCE:
=CELL("address",INDEX($A$1:$M$10,SUMPRODUCT(($A$1:$M$10="John")*ROW($A$1:$M$10)),SUMPRODUCT(($A$1:$M$10="John")*COLUMN($A$1:$M$10))))

If you want the 1st instance of the Name in A1:M10 (ARRAY FORMULA*):
=CELL("address",INDEX($A$1:$M$10,MIN(IF($A$1:$M$10="John",ROW($A$1:$M$10))),MIN(IF($A$1:$M$10="John",COLUMN($A$1:$M$10)))))

*Note: For array formulas, hold down [Ctrl] and [Shift] when you press
[Enter], instead of just pressing [Enter].

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"et" wrote:

Hi all,

I have a worksheet that contains some names in it, I can find them by
using
Vlookup, but I would like to know when they are (cell reference) too, is
there any formula can help me to locate their cells ?

Anyone can help ? Thanks.
et




--

Dave Peterson

.



Relevant Pages

  • Re: deleting instance in array
    ... > I would to know if it is possible to delete an instance in an array, ... > I am trying to find and delete the duplicate in an array, ... Get yourself a modern C++ book that teaches you about vectors. ...
    (comp.lang.cpp)
  • Re: Repost (Comparing two ranges)
    ... I was on the right track assuming a countif type function instead of ... The result does not take into account the duplicate ... Is there a way to compare two ranges where you can create an array ... Remember I want to put it into a SUMPRODUCT function. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: How to choose Random rows??
    ... whole numbers could return duplicate values if the range between Min and ... This function will return an array of random Long Integers between the values of Minimum and Maximum....It is possible that there will be duplicated values in the result array. ... A common requirement is the selection of some number of elements at random and without repetition ... ClassicVB Users Regroup! ...
    (microsoft.public.excel.programming)
  • RE: Speed up Array Transfer to Dictionary
    ... of comparisons every time you have a known duplicate. ... array with themselves. ... array in the first place as a dictionary cannot have duplicate keys. ... dupe = dupe + 1 ...
    (microsoft.public.excel.programming)
  • Re: Repost (Comparing two ranges)
    ... range A2:A6 to drive data validation dropdown boxes in the range B9:D11. ... The result does not take into account the duplicate ... Is there a way to compare two ranges where you can create an array ... Remember I want to put it into a SUMPRODUCT function. ...
    (microsoft.public.excel.worksheet.functions)