ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Using the "if" function, the "and" function and the "or" function (https://www.excelbanter.com/new-users-excel/257557-using-if-function-function-function.html)

Superblonde64

Using the "if" function, the "and" function and the "or" function
 
I am not sure if or how to use all three in a formula. For example:

=if(b2="red", and c3="blue", d6="green")

if that makes sense at all.

Dave Peterson

Using the "if" function, the "and" function and the "or" function
 
Maybe something like:

=if(and(b2="red",c3="blue",d6="green"),"all three match!","not all 3 match")

or

=if(or(b2="red",c3="blue",d6="green"),"at least one matches","none match")

or you can use both to make the criteria more complex

=if(and(b2="red",or(c3="blue",d6="green")),then,el se)
B2 has to be red and either (or both) c3=blue or d6=green
for the "then" portion to be returned.
anything else, and you get the else portion.



Superblonde64 wrote:

I am not sure if or how to use all three in a formula. For example:

=if(b2="red", and c3="blue", d6="green")

if that makes sense at all.


--

Dave Peterson


All times are GMT +1. The time now is 02:50 PM.

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