ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Custom Functions (https://www.excelbanter.com/excel-programming/297501-custom-functions.html)

[email protected]

Custom Functions
 
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

tod

Custom Functions
 
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

-----Original Message-----
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
.


david mcritchie

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




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

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