Forum Discussion

Sofia2165's avatar
Sofia2165
Copper Contributor
Jul 22, 2021

If functions

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

  • NikolinoDE's avatar
    NikolinoDE
    Platinum Contributor

    Sofia2165 

     

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

    Example in the inserted file

     

    Thank you for your patience and time.

     

    Nikolino

    I know I don't know anything (Socrates)

  • NikolinoDE's avatar
    NikolinoDE
    Platinum Contributor

    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)

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    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?

    • Sofia2165's avatar
      Sofia2165
      Copper Contributor
      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.
      • Yea_So's avatar
        Yea_So
        Bronze Contributor
        IF(AND(A=TRUE,B=TRUE), DoThisAction, DoThatAction)
        IF(AND(A=5,B=5), x*y, x-y)

Resources