Data Query Formula

M

Moses

Ive been racking my brain trying to figure this out on my own but can't seem
to get it right. The problem that I have is I am trying to match phone
numbers in a column with a data base of the first 6 digits of the number that
I can call, and either get a true or fasle or any thing that will indicate
that I can call those numbers.

Example:
Number NPANXX Results
2813356789 281225 False
2813377896 281337 True
2815672345 281445 False
2813458765 False
2814452321 True

The results shoud be (False,True,False,False,True) in column C because the
number does not have the the first 6 digits
 
M

Max

One way ..

Assuming data in row2 down

In C2:
=SUMPRODUCT(--ISNUMBER(SEARCH($B$2:$B$4,A2)))>0
Copy C2 down to return the required results

If there could be the possibility of blank cells within the reference set of
numbers in B2:B4, use this slightly longer version in C2, copied down:
=SUMPRODUCT(ISNUMBER(SEARCH($B$2:$B$4,A2))*($B$2:$B$4<>""))>0

Adapt the reference range to suit: $B$2:$B$4
 
R

Ron Coderre

Try something like this:

With your posted scenario

C2: =COUNTIF($B$2:$B$4,LEFT(A2,6))=1

Copy that formula down as far as you need

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

XL2002, WinXP
 
Top