View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Getting all positions of a value in an array or reference

see your other post

--
Biff
Microsoft Excel MVP


"ORLANDO VAZQUEZ" wrote in message
...
Hi Alan,

I think I need to use this formula you show on your website but I can't
get
it to work.
I have a column of values in column a. Can you help me ?

For example the formula should look up col.A # 22 and return fro col.D the
following list: Dog Biscuit Steak

A B C D

22 34 Apple
33 34 Fish
16 22 Dog
91 1 Orange
15 3 Tangerine
14 22 Biscuit
21 1 Tea
34 5 Salmon
17 22 Steak
7 Herring
8 Cod
1 Orange
1 Castle



Function VLookups(lookupValue, lookupArray, ColumnNumber)
'This function acts somewhat like the built-in VLookup
'Function with exact matches, except that it returns an
'array of all the values corresponding to multiple
'occurrences of the sought value in the left hand column
'(i.e., the first column vector in the lookup array).


"Alan Beban" wrote:

Yossi wrote:
Hi,
I have a reference to a row and in that row, several cells have the
value of
1. I would like to get the positions of all of them from the array.
For example:
A1 A2 A3 A4 A5 A6
1 0 1 1 0 0

I would like to get A1, A3, A4
is there a way to retrieve that information in a single formula?
thanks


If the functions in the freely downloadable file at
http:?home.pacbell.net/beban are available to your workbook

=INDEX(ArrayMatch(1,$A$1:$A$6,"A",4),ROW(A1)) entered in a cell and
copied down until you get a #REF! error; or
=IF(NOT(ISERROR(INDEX(ArrayMatch(1,$A$1:$A$6,"A",4 ),ROW(A1)))),INDEX(ArrayMatch(1,$A$1:$A$6,"A",4),R OW(A1)),"")
copied down the length of the data file (6 in this case).

Alan Beban,