ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Three condition "if" statements (https://www.excelbanter.com/excel-discussion-misc-queries/249448-three-condition-if-statements.html)

Tel

Three condition "if" statements
 
I'm trying to write an IF statement that needs to look at the input of three
cells (D4, D5 and D6).

If any of them are "YES" then I need cell E4 to = cell G1. However,
If they are all "no" then I need cell E4 to = cell G2

Finally, if they are all blank then I need cell e4 to be blank

Also, if I do this can I conditionally format cell E4 so if it = G1 then it
is White text on a red background, and if it = G2 then it is Black text on a
green background (I'm okay with CF just need to know if it's possible)

Looking forward to your replies.

TVM

Terry

Ms-Exl-Learner

Three condition "if" statements
 
Try this in E4 Cell

=IF(OR(D4="YES",D5="YES",D6="YES"),G1,IF(AND(D4="N O",D5="NO",D6="NO"),G2,IF(AND(D4="",D5="",D6="")," ","Value is not Matching the Criteria")))

If this post helps, Click Yes!

--------------------
(Ms-Exl-Learner)
--------------------



"Tel" wrote:

I'm trying to write an IF statement that needs to look at the input of three
cells (D4, D5 and D6).

If any of them are "YES" then I need cell E4 to = cell G1. However,
If they are all "no" then I need cell E4 to = cell G2

Finally, if they are all blank then I need cell e4 to be blank

Also, if I do this can I conditionally format cell E4 so if it = G1 then it
is White text on a red background, and if it = G2 then it is Black text on a
green background (I'm okay with CF just need to know if it's possible)

Looking forward to your replies.

TVM

Terry


Tel

Three condition "if" statements
 
Many thanks for your reply, I've astounded myself by being able to work it
out, as follows:

=IF(AND(D4=G5,D5=G5,D6=G5),G11,IF(OR(D4=G4,D5=G4,D 6=G4),G2,""))

The CF was simple too, essentially Condition 1 Cell Value is - equal to -
=G1 (Set format)
Condition 2 Cell Value is - equal to - -G2 (Set format)

Probably basic to others but someone might find it useful.

Terry

"Ms-Exl-Learner" wrote:

Try this in E4 Cell

=IF(OR(D4="YES",D5="YES",D6="YES"),G1,IF(AND(D4="N O",D5="NO",D6="NO"),G2,IF(AND(D4="",D5="",D6="")," ","Value is not Matching the Criteria")))

If this post helps, Click Yes!

--------------------
(Ms-Exl-Learner)
--------------------



"Tel" wrote:

I'm trying to write an IF statement that needs to look at the input of three
cells (D4, D5 and D6).

If any of them are "YES" then I need cell E4 to = cell G1. However,
If they are all "no" then I need cell E4 to = cell G2

Finally, if they are all blank then I need cell e4 to be blank

Also, if I do this can I conditionally format cell E4 so if it = G1 then it
is White text on a red background, and if it = G2 then it is Black text on a
green background (I'm okay with CF just need to know if it's possible)

Looking forward to your replies.

TVM

Terry



All times are GMT +1. The time now is 04:55 AM.

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