Conditional format with wildcard in formula

immyjimmy

Active Member
Joined
May 27, 2002
Messages
257
I am trying to write a conditional formating IF statement that requires the use of a wildcard (?)

If the value of C1 is "abs 2" then true.
If the value of C1 is "als 2" then true.
If the value of C1 is "aby 2" then false.

=IF(C1="a"&?&"s 2",1,0) #returns error upon hitting Enter#
=IF(C1="a"&"?"&"s 2",1,0) #condition met if value is "a?s 2"
=IF(C1="a"&'?'&"s 2",1,0) #returns error upon hitting Enter#
=IF(C1="a"&\?&"s 2",1,0) #Excel allows formula, but does not change cell#

Any further ideas?

Thanks in advance,
Jim

I love cats. They taste like chicken.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Jim, How about a different slant on the problem:
Code:
=IF(Left(C1) & Right(c1,3)="as 2",1,0)
 
Upvote 0
That's the route I've been using. I was looking for something a bit more elegant and simple. It also doesn't limit the filtering to a single character. ie.

abs 2
acs 2
achs 2

With this method, that last line would still show true even though there were extra characters. Fortunately in my situation, the data is imported from a limited field in a database and therefore unlikely to have typos. If this data were hand-entered, I'd have to spend some time on error checking. So I guess there is no sort of "wildcard" usage in a formula then.

Thanks,
Jim

I used to eat a lot of natural foods until I learned that most people die of natural causes.
 
Upvote 0

Forum statistics

Threads
1,214,611
Messages
6,120,513
Members
448,967
Latest member
screechyboy79

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top