ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Using wildcards in formulas (https://www.excelbanter.com/excel-discussion-misc-queries/227918-using-wildcards-formulas.html)

KrispyData

Using wildcards in formulas
 
I want to create a formula that states: if cell in columnA ends in (L) then
show result in ColumnB as Local.

sample data:
ColumnA
1.Wow Widget Store (L)
2.Widgets N More
3.Major Widget Store (L)
4.Allstar Widgets

I tried using the following formula:
if(A1="*(L)","Local","no)
Excel will not accept that. Any suggestions?

Mike H

Using wildcards in formulas
 
Try this

=IF(RIGHT(A1,1)="L","Local","No")

Mike

"KrispyData" wrote:

I want to create a formula that states: if cell in columnA ends in (L) then
show result in ColumnB as Local.

sample data:
ColumnA
1.Wow Widget Store (L)
2.Widgets N More
3.Major Widget Store (L)
4.Allstar Widgets

I tried using the following formula:
if(A1="*(L)","Local","no)
Excel will not accept that. Any suggestions?


Dave Peterson

Using wildcards in formulas
 
If it ends in (L), then:
=IF(RIGHT(A1,3)="(L)","Local","No")

if you really wanted a wild card, you could use:
=if(countif(a1,"*(L)")0,"Local","no")

(But I wouldn't use it in this situation.)







KrispyData wrote:

I want to create a formula that states: if cell in columnA ends in (L) then
show result in ColumnB as Local.

sample data:
ColumnA
1.Wow Widget Store (L)
2.Widgets N More
3.Major Widget Store (L)
4.Allstar Widgets

I tried using the following formula:
if(A1="*(L)","Local","no)
Excel will not accept that. Any suggestions?


--

Dave Peterson

Teethless mama

Using wildcards in formulas
 
=IF(RIGHT(A1,3)="(L)","Local","no")


"KrispyData" wrote:

I want to create a formula that states: if cell in columnA ends in (L) then
show result in ColumnB as Local.

sample data:
ColumnA
1.Wow Widget Store (L)
2.Widgets N More
3.Major Widget Store (L)
4.Allstar Widgets

I tried using the following formula:
if(A1="*(L)","Local","no)
Excel will not accept that. Any suggestions?


Jarek Kujawa[_3_]

Using wildcards in formulas
 
provided (L) determines the "locality" only you might use the following
formula:

=IF(FIND("(L)",A1),"Local")

HIH



Użytkownik "KrispyData" napisał w
wiadomości ...
I want to create a formula that states: if cell in columnA ends in (L)
then
show result in ColumnB as Local.

sample data:
ColumnA
1.Wow Widget Store (L)
2.Widgets N More
3.Major Widget Store (L)
4.Allstar Widgets

I tried using the following formula:
if(A1="*(L)","Local","no)
Excel will not accept that. Any suggestions?




KrispyData

Using wildcards in formulas
 
Perfect! Thank you!

"Dave Peterson" wrote:

If it ends in (L), then:
=IF(RIGHT(A1,3)="(L)","Local","No")

if you really wanted a wild card, you could use:
=if(countif(a1,"*(L)")0,"Local","no")

(But I wouldn't use it in this situation.)







KrispyData wrote:

I want to create a formula that states: if cell in columnA ends in (L) then
show result in ColumnB as Local.

sample data:
ColumnA
1.Wow Widget Store (L)
2.Widgets N More
3.Major Widget Store (L)
4.Allstar Widgets

I tried using the following formula:
if(A1="*(L)","Local","no)
Excel will not accept that. Any suggestions?


--

Dave Peterson



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

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