If functions

%3CLINGO-SUB%20id%3D%22lingo-sub-2573931%22%20slang%3D%22en-US%22%3EIf%20functions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2573931%22%20slang%3D%22en-US%22%3E%3CP%3ELooking%20for%20a%20formula%20that%20can%20say%20'if%20A%20plus%20B%20happens%20take%20action%20X%2C%20but%20if%20A%20and%20C%20instead%20happens%20then%20take%20action%20Y'.%20Is%20that%20possible%20in%20Excel%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2573931%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2573968%22%20slang%3D%22en-US%22%3ERe%3A%20If%20functions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2573968%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1109791%22%20target%3D%22_blank%22%3E%40Sofia2165%3C%2FA%3E%26nbsp%3BWhat%20do%20you%20mean%20by%20%22happens%22%3F%26nbsp%3B%3CSTRONG%3EIF%3C%2FSTRONG%3E%20A%20and%20B%20contain%20a%20certain%20value%2C%20or%20%3CSTRONG%3EIF%3C%2FSTRONG%3E%20A%20%2B%20B%20add%20up%20to%20a%20certain%20value%3F%20Or%20perhaps%20IF%20both%20A%20and%20B%20are%20not%20blank%2Fempty%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2574015%22%20slang%3D%22en-US%22%3ERe%3A%20If%20functions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2574015%22%20slang%3D%22en-US%22%3EHi%20Riny%3CBR%20%2F%3EA%20and%20B%20are%20not%20values%20nor%20blank.%20I'm%20basically%20trying%20to%20say%20that%20if%20two%20particular%20criteria%20are%20met%20(A%20and%20B)%20then%20the%20required%20action%20should%20be%20X.%20Neither%20the%20criteria%20nor%20the%20action%20is%20numeric%20values.%3CBR%20%2F%3E%3CBR%20%2F%3EExample%3A%3CBR%20%2F%3EBlue%20%2B%20Yellow%20is%20Green%2C%20but%20Blue%20%2B%20Red%20is%20purple.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2574067%22%20slang%3D%22en-US%22%3ERe%3A%20If%20functions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2574067%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1109791%22%20target%3D%22_blank%22%3E%40Sofia2165%3C%2FA%3E%26nbsp%3BStill%20not%20very%20clear.%20If%20you%20have%20an%20example%20workbook%20that%20demonstrates%20what%20you%20want%20to%20achieve%2C%20please%20upload%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2574102%22%20slang%3D%22en-US%22%3ERe%3A%20If%20functions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2574102%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1109791%22%20target%3D%22_blank%22%3E%40Sofia2165%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20help%20me%2C%20I'm%20a%20little%20irritated%20by%20your%20request.%3CBR%20%2F%3EYou%20would%20like%20to%20know%20if%20A%20plus%20B%20happens%20take%20action%20X%2C%20but%20if%20A%20and%20C%20instead%20happens%20then%20take%20action%20Y%20'.%3CBR%20%2F%3EWhat%20should%20happen%20if%20A%20plus%20B%20and%20A%20and%20C%20appear%20at%20the%20same%20time%3F%3CBR%20%2F%3EWouldn't%20it%20help%20if%20only%20A%20was%20searched%20for%20a%20certain%20value%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20your%20patience%20and%20time.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENikolino%3C%2FP%3E%3CP%3EI%20know%20I%20don't%20know%20anything%20(Socrates)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2574236%22%20slang%3D%22en-US%22%3ERe%3A%20If%20functions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2574236%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1109791%22%20target%3D%22_blank%22%3E%40Sofia2165%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELooks%20like%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DIF(%20(A%3D%22Blue%22)*(B%3D%22Yellow%22)%2C%20%22Green%22%2C%20IF(%20(A%3D%22Blue%22)*(B%3D%22Red%22)%2C%20%22Purple%22%2C%20%22Color%20is%20not%20defined%22))%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
New Contributor

Looking for a formula that can say 'if A plus B happens take action X, but if A and C instead happens then take action Y'. Is that possible in Excel?

9 Replies

@Sofia2165 What do you mean by "happens"? IF A and B contain a certain value, or IF A + B add up to a certain value? Or perhaps IF both A and B are not blank/empty?

Hi Riny
A and B are not values nor blank. I'm basically trying to say that if two particular criteria are met (A and B) then the required action should be X. Neither the criteria nor the action is numeric values.

Example:
Blue + Yellow is Green, but Blue + Red is purple.

@Sofia2165 Still not very clear. If you have an example workbook that demonstrates what you want to achieve, please upload it.

 

@Sofia2165 

 

Please help me, I'm a little irritated by your request.
You would like to know if A plus B happens take action X, but if A and C instead happens then take action Y '.
What should happen if A plus B and A and C appear at the same time?
Wouldn't it help if only A was searched for a certain value?

 

Thank you for your patience and time.

 

Nikolino

I know I don't know anything (Socrates)

@Sofia2165 

Looks like

=IF( (A="Blue")*(B="Yellow"), "Green", IF( (A="Blue")*(B="Red"), "Purple", "Color is not defined"))

@Sofia2165 

 

If you want to control values in A, B and C then this would be a simple solution.

Example in the inserted file

IF_A_B_C.JPG

 

Thank you for your patience and time.

 

Nikolino

I know I don't know anything (Socrates)

@Riny_van_Eekelen

What i'm trying to do is a form of risk assessment/analysis. But rather than a matrix, I was looking to have input fields (likely from a drop-down) for risk and likelyhood and then a show the consequence and severity if it were to happen.

@Sofia2165 Sorry for being slow, but can you explain how the matrix relates to your very first post "if A plus B happens take action X" ?

 

IF(AND(A=TRUE,B=TRUE), DoThisAction, DoThatAction)
IF(AND(A=5,B=5), x*y, x-y)