IF function

L

Lost Cluster

I’m using the If Function to compare a string of text to a letter. This is
what I have

ColA has names ColB has the days off in this format (string of text)
Su/M/Tu-Th ColC-J have the days of the week Monday-Sunday. I want the names
of Col A to appear in Col C-J if they work those days. So the If Function
that I’m using is: =IF(B1<>"M",A1,"")
But it’s not working. I’m trying to say that if ColB does not equal M
(Monday) then put the name from ColA under Monday.
Thanks
 
D

Dave Peterson

The asterisks won't be treated as wildcards in that formula.

But =countif() does support wildcards:
=if(countif(b1,"*M*")=0,A1,"")

Or =find()/=search():

=if(iserror(find("M",b1)),a1,"")

=find() is case sensitive
=search() is not case sensitive
 
M

Ms-Exl-Learner

Not sure whether this is what you are looking for…

If the First Character of B1 <> M
=IF(TRIM(LEFT(B1,1))<>"M",A1,"")

Or

If you want to look B1 cell whether its having the character M in any case
(Upper or Lower)
=IF(ISNUMBER(SEARCH("M",B1))=FALSE,A1,"")

Or

If you want to look B1 cell whether its having the character M only in upper
case.
=IF(ISNUMBER(FIND("M",B1))=FALSE,A1,"")

Remember to Click Yes, if this post helps!
 
F

FSt1

and you're right. i did test but not the right way.
also tested..
=IF(MID(B2,4,1)="m",A2,"")
=IF(FIND("M",B2,1)=4,A2,"")
i should have posted those.

thanks for the corrections.
regards
FSt1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

SUMIFS help 3
Data Validation 1
=NameCheck - Monday??? 3
Random names from short list 4
Help with my Lotto code please 10
Sum of squares if condition 4
Function returns a list 2
link text cells on different sheets 3

Top