ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Test of Multiple Conditions in an IF statement (https://www.excelbanter.com/excel-worksheet-functions/219968-test-multiple-conditions-if-statement.html)

Joe[_13_]

Test of Multiple Conditions in an IF statement
 
What is the correct format to test for multiple conditions in an IF
statement? I want to test if both of two conditions are correct.

The format I am using is =IF((D1415) AND (G14="Y") . . .) but Excel won't
accept that saying that the "logical test" is invalid. Both cells being
tested do exist.

Any ideas?
--
jws21

ExcelBanter AI

Answer: Test of Multiple Conditions in an IF statement
 
Hi jws21,

To test for multiple conditions in an IF statement, you can use the AND or OR function. The correct format for testing if both of two conditions are correct using the AND function is:
  1. =IF(AND(D1415,G14="Y"), value_if_true, value_if_false)

In this formula, the AND function is used to test if both conditions are true. If both conditions are true, the formula will return the value_if_true result. If either condition is false, the formula will return the value_if_false result.

Make sure to replace "value_if_true" and "value_if_false" with the appropriate values or formulas for your specific situation.

Best regards,

Don Guillett

Test of Multiple Conditions in an IF statement
 
Go to the help index and take a look at
AND
for the proper syntax

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Joe" (donotspam) wrote in message
...
What is the correct format to test for multiple conditions in an IF
statement? I want to test if both of two conditions are correct.

The format I am using is =IF((D1415) AND (G14="Y") . . .) but Excel won't
accept that saying that the "logical test" is invalid. Both cells being
tested do exist.

Any ideas?
--
jws21



Luke M

Test of Multiple Conditions in an IF statement
 
You've posted this question several times now, Joe. Try reading some of the
responses.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Joe" wrote:

What is the correct format to test for multiple conditions in an IF
statement? I want to test if both of two conditions are correct.

The format I am using is =IF((D1415) AND (G14="Y") . . .) but Excel won't
accept that saying that the "logical test" is invalid. Both cells being
tested do exist.

Any ideas?
--
jws21


Shane Devenshire[_2_]

Test of Multiple Conditions in an IF statement
 
Hi,

=IF(AND(A1=1,B1="Red"),True,False)
or
=IF(OR(A1=1,B1="Red"),True,False)

You can have up to 30 tests inside the AND or OR in 2003.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Joe" wrote:

What is the correct format to test for multiple conditions in an IF
statement? I want to test if both of two conditions are correct.

The format I am using is =IF((D1415) AND (G14="Y") . . .) but Excel won't
accept that saying that the "logical test" is invalid. Both cells being
tested do exist.

Any ideas?
--
jws21



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

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