Custom Functions

  • Thread starter Thread starter allancole44
  • Start date Start date
A

allancole44

Want to use and mix multiple AND and OR in condition
statement in Custom Function.

Format as "If Condition1 and Condition2 and etc.

Does not work.

Assistance requested.

Thanks
 
If you are speaking of VBA code, you would use AND and OR
like this:

Dim MyName as String

MyName = "tod"

If MyName = "tod" and MyName <> "Fred" Then
'code
End If

IF MyName = "tod" or MyName = "Fred" Then
'code
End If



If you are using a formula:

=If(And(A1="tod",B1<>"Fred"),True,False)

=If(Or(A1="tod",A1="Fred"),True,False)

tod
 
and in VBA those examples would be case sensitive
and the Worksheet Function examples would be case insensitive.
 

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

Back
Top