ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Data Query Formula (https://www.excelbanter.com/excel-worksheet-functions/120307-data-query-formula.html)

Moses

Data Query Formula
 
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

Max

Data Query Formula
 
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
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Moses" wrote:
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


Ron Coderre

Data Query Formula
 
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


"Moses" wrote:

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


driller

Data Query Formula
 
not sure

=ISNUMBER(SEARCH(a1,b$1:b$10,1))

happy holidays

"Moses" wrote:

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


Max

Data Query Formula
 
Dang! Could have sworn the earlier options worked fine <g
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---




All times are GMT +1. The time now is 12:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com