IF Function Help with Wildcard

KuraiChikara

Board Regular
Joined
Nov 16, 2016
Messages
111
Office Version
  1. 2013
Platform
  1. Windows
Hello,
I am trying to incorporate the wildcard "*" into an IF function and I'm not sure what's wrong so I will break down what I am attempting to do.

Process:
In column A I could have various days of the week formats that go from Friday to Thursday and they look like this
F--MTWR
FY--TWR
FYS--WR
etc, etc.

I already utilize a COUNT IF function with a wildcard to help me count weeks that might have an M for Monday or T for Tuesdays.
In my three week examples above, using this formula =COUNTIF($A$1:$A$3,"*M*") does return a 1, because only 1 of those days has an M for Monday.

My problem
I'm now trying to use a similar wildcard process in an IF statement, but I can't seem to get it to work.

If column A1 has the following day of the week in it F--MTWR
I'm trying to us an IF statement to place certain days of the week if they contain certain letters.

In column B1 I put in the formula =IF(A1="*M*",A1,"") but I just get a blank placement.

For me, to help understand excel, I verbalize the problem: If cell A1 contains an M, put in the contents of A1, otherwise if not M, put blank.
The result however that I receive is blank.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
You cannot use wildcards in IF like that, try
Excel Formula:
=IF(ISNUMBER(SEARCH("M",A1)),A1,"")
 
Upvote 0
That works, thank you very much.

My biggest issue with excel is I understand it pretty well but still not well enough.
Because I know understanding the requirements of each argument is key like equality/inequality formulas or functions that return a boolean function and I usually can't break excel that far down which is why I ask for help.

I'm still trying to learn but I get frustrated when one function works in a certain setup and a different function will not work with the same setup.
Thank you again.
 
Upvote 0
You're welcome & thanks for the feedback.
I get frustrated when one function works in a certain setup and a different function will not work with the same setup.
I know what you mean.
 
Upvote 0

Forum statistics

Threads
1,213,517
Messages
6,114,089
Members
448,548
Latest member
harryls

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