(Reading time: 1 minute)

Excel provides support for both logical and and or. The keyword and is used for "and" operation and the keyword or is used for "or" operation.

 

Examples

 
 
 
if ((condition1) and (condition2)) then
 
 
msgbox "I am here"
 
 
end if
 
 
 

The above code displays the message box, if both condition1 and condition2 are true.

 

 
 
 
if ((condition1) or (condition2)) then
 
 
msgbox "I am here"
 
 
end if
 
 
 

The above code displays the message box, if either condition1 or condition2 is true.

Oxygen
Author: Oxygen
Other articles by this author

Chillzee Tag Cloud

Let's Socialize

About Chillzee

Chillzee.com is an entrepreneurship portal.

The site provides informative topics on Organizational and Strategic needs.