"Carl" <cscarlson@cox.net> wrote
> .. First, the "pairs" do not have to be in any order.
Here's a revised crack at it using non-array formulas
which now covers the above ..
Revised sample at:
http://cjoint.com/?bei1Z6MgzL
Locate and use twin pairs of numbers in a range_Carl_v2.xls
Assumptions made:
Source data in A1:I9
Only integers 0 - 9 (single digit)
Only 1 occurence of the "Pairs"
Pairs can be in any order, e.g: 2,4 and 2,4 or 2,4 and 4,2
Placed in:
J1: =IF(COUNT(A1:I1)=2,"x","")
K1: =IF(J1="x",A1&B1&C1&D1&E1&F1&G1&H1&I1,"")
L1:
=IF(SUMPRODUCT((K1<>"")*(ISNUMBER(SEARCH(LEFT(K1,1),$K$1:$K$9))*(ISNUMBER(SE
ARCH(RIGHT(K1,1),$K$1:$K$9)))))=2,"x","")
M1:
=IF(K1="","",IF(AND(COUNTIF($L$1:L1,L1)=2,LEFT(K1,1)<>RIGHT(K1,1)),"x",""))
N1: =IF(OR(COUNT(A1:I1)={0,2}),"",IF(COUNT(A1:I1)>2,"x",""))
Placed in O1, O1 copied to W1:
=IF(A1="","",IF(ISNA(MATCH("x",$M:$M,0)),A1,IF(AND($N1="x",OR(A1=LEFT(INDEX(
$K:$K,MATCH("x",$M:$M,0)),1)+0,A1=RIGHT(INDEX($K:$K,MATCH("x",$M:$M,0)),1)+0
)),"",A1)))
J1:W1 selected and copied down to W9
O1:W9 returns the desired results
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
Bookmarks