ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I use a wildcard in an excel formula? (https://www.excelbanter.com/excel-worksheet-functions/134909-how-do-i-use-wildcard-excel-formula.html)

Archon007

How do I use a wildcard in an excel formula?
 
I am try to have an if command search a row of data and then print 1 if it
matchs and a 0 if it doesn't. However the data is a long string of numbers
that can be identified after reading the first 3. So instead of having to
type it all out I'd like it to do something like.

=if(a1=910*,1,0)

the * meaning anything after 910 that matches, so if a1 is 910111564 or
910465465 it will return 1, but if it is 911(anything) it will return a 0

Thanks

Bob Davison

How do I use a wildcard in an excel formula?
 
=IF(LEFT(A1,3)="910",1,0)

"Archon007" wrote in message
...
I am try to have an if command search a row of data and then print 1 if it
matchs and a 0 if it doesn't. However the data is a long string of
numbers
that can be identified after reading the first 3. So instead of having to
type it all out I'd like it to do something like.

=if(a1=910*,1,0)

the * meaning anything after 910 that matches, so if a1 is 910111564 or
910465465 it will return 1, but if it is 911(anything) it will return a 0

Thanks




Teethless mama

How do I use a wildcard in an excel formula?
 
=--ISNUMBER(FIND(910,A1))


"Archon007" wrote:

I am try to have an if command search a row of data and then print 1 if it
matchs and a 0 if it doesn't. However the data is a long string of numbers
that can be identified after reading the first 3. So instead of having to
type it all out I'd like it to do something like.

=if(a1=910*,1,0)

the * meaning anything after 910 that matches, so if a1 is 910111564 or
910465465 it will return 1, but if it is 911(anything) it will return a 0

Thanks


T. Valko

How do I use a wildcard in an excel formula?
 
if a1 is 910111564 or 910465465 it will return 1
=--ISNUMBER(FIND(910,A1))


123456910

Biff

"Teethless mama" wrote in message
...
=--ISNUMBER(FIND(910,A1))


"Archon007" wrote:

I am try to have an if command search a row of data and then print 1 if
it
matchs and a 0 if it doesn't. However the data is a long string of
numbers
that can be identified after reading the first 3. So instead of having
to
type it all out I'd like it to do something like.

=if(a1=910*,1,0)

the * meaning anything after 910 that matches, so if a1 is 910111564 or
910465465 it will return 1, but if it is 911(anything) it will return a 0

Thanks




Bob Davison

How do I use a wildcard in an excel formula?
 
Here are better ways to do it:

=IF(LEFT(A1,3)=TEXT($E$1,"0"),1,0) ...where the value in cell E1 equals the
3-digit search value.

or better...
=IF(LEFT(A1,LEN($E$1))=TEXT($E$1,"0"),1,0) ...where the value in cell E1
equals the search value of variable length.

or even...
=IF(LEFT(A1,LEN(numString))=TEXT(numString,"0"),1, 0) ...where the value in
the single-cell named range "numString" equals a search value of variable
length.

This avoids hard-coding the formula.

Bob


"Bob Davison" wrote in message
...
=IF(LEFT(A1,3)="910",1,0)

"Archon007" wrote in message
...
I am try to have an if command search a row of data and then print 1 if it
matchs and a 0 if it doesn't. However the data is a long string of
numbers
that can be identified after reading the first 3. So instead of having
to
type it all out I'd like it to do something like.

=if(a1=910*,1,0)

the * meaning anything after 910 that matches, so if a1 is 910111564 or
910465465 it will return 1, but if it is 911(anything) it will return a 0

Thanks







All times are GMT +1. The time now is 06:36 PM.

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