Thread: Lookup function
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Harlan Grove Harlan Grove is offline
external usenet poster
 
Posts: 733
Default Lookup function

<DLS wrote...
....
Example: Worksheet 1 Worksheet 2
1 1
2 3
3 8
4 1
5 5
I need to know the position and existance of the second number 1.


If the worksheet 1 range started in cell A1, then the row index of the 2nd
instance of Worksheet1!A1 in Worksheet2!B:B (which I'll name WS2B) would be
given by

C1:
=IF(COUNTIF(WS2B,A1)1,
MATCH(A1,OFFSET(WS2B,MATCH(A1,WS2B,0),0),0)+MATCH( A1,WS2B,0),
"no second instance")

Fill down as needed.