Nested IF/AND Statements in Google Sheets










0















I'm trying to use nested IF/AND statements in google sheets in order to assign a value to cells for an email trigger. Individuals go through a form and based on the results (if the training they're registering for is virtual, on the ground, or occurring in our learning management system Blackboard).



Right now the code is as follows:
=IF($E2="","",IF($G2="INPERSON","PERSONSEND",IF($G2="VIRTUALLY","VIRTUALSEND","")))



This code essentially just says if there is something in the form submit email (E2) and the training occurs in person, assign the value "INPERSON" to the email trigger. Likewise, if the training occurs virtually.



However what I want to do is add an AND statement that says if the attendance type is "VIRTUALLY" AND the webinar link in column H is "Hosted in Blackboard" then the output should be a new value called "BLACKBOARDSEND".



The code I've used so far only results in the error "Wrong number of arguments to IF. Expected between 2 and 3 arguments, but got 4 arguments."



=IF($E2="","",IF($G2="IN PERSON","PERSONSEND",IF($G2="VIRTUALLY","VIRTUALSEND","",IF(AND($G2="IN PERSON", $H2="Hosted in Blackboard","BLACKBOARDSEND","")))))



Test sheet link included: https://docs.google.com/spreadsheets/d/1RK4-KDlCctg49RK05voVb-COmk_7gZYHmk7gYbK-pMo/edit?usp=sharing










share|improve this question


























    0















    I'm trying to use nested IF/AND statements in google sheets in order to assign a value to cells for an email trigger. Individuals go through a form and based on the results (if the training they're registering for is virtual, on the ground, or occurring in our learning management system Blackboard).



    Right now the code is as follows:
    =IF($E2="","",IF($G2="INPERSON","PERSONSEND",IF($G2="VIRTUALLY","VIRTUALSEND","")))



    This code essentially just says if there is something in the form submit email (E2) and the training occurs in person, assign the value "INPERSON" to the email trigger. Likewise, if the training occurs virtually.



    However what I want to do is add an AND statement that says if the attendance type is "VIRTUALLY" AND the webinar link in column H is "Hosted in Blackboard" then the output should be a new value called "BLACKBOARDSEND".



    The code I've used so far only results in the error "Wrong number of arguments to IF. Expected between 2 and 3 arguments, but got 4 arguments."



    =IF($E2="","",IF($G2="IN PERSON","PERSONSEND",IF($G2="VIRTUALLY","VIRTUALSEND","",IF(AND($G2="IN PERSON", $H2="Hosted in Blackboard","BLACKBOARDSEND","")))))



    Test sheet link included: https://docs.google.com/spreadsheets/d/1RK4-KDlCctg49RK05voVb-COmk_7gZYHmk7gYbK-pMo/edit?usp=sharing










    share|improve this question
























      0












      0








      0








      I'm trying to use nested IF/AND statements in google sheets in order to assign a value to cells for an email trigger. Individuals go through a form and based on the results (if the training they're registering for is virtual, on the ground, or occurring in our learning management system Blackboard).



      Right now the code is as follows:
      =IF($E2="","",IF($G2="INPERSON","PERSONSEND",IF($G2="VIRTUALLY","VIRTUALSEND","")))



      This code essentially just says if there is something in the form submit email (E2) and the training occurs in person, assign the value "INPERSON" to the email trigger. Likewise, if the training occurs virtually.



      However what I want to do is add an AND statement that says if the attendance type is "VIRTUALLY" AND the webinar link in column H is "Hosted in Blackboard" then the output should be a new value called "BLACKBOARDSEND".



      The code I've used so far only results in the error "Wrong number of arguments to IF. Expected between 2 and 3 arguments, but got 4 arguments."



      =IF($E2="","",IF($G2="IN PERSON","PERSONSEND",IF($G2="VIRTUALLY","VIRTUALSEND","",IF(AND($G2="IN PERSON", $H2="Hosted in Blackboard","BLACKBOARDSEND","")))))



      Test sheet link included: https://docs.google.com/spreadsheets/d/1RK4-KDlCctg49RK05voVb-COmk_7gZYHmk7gYbK-pMo/edit?usp=sharing










      share|improve this question














      I'm trying to use nested IF/AND statements in google sheets in order to assign a value to cells for an email trigger. Individuals go through a form and based on the results (if the training they're registering for is virtual, on the ground, or occurring in our learning management system Blackboard).



      Right now the code is as follows:
      =IF($E2="","",IF($G2="INPERSON","PERSONSEND",IF($G2="VIRTUALLY","VIRTUALSEND","")))



      This code essentially just says if there is something in the form submit email (E2) and the training occurs in person, assign the value "INPERSON" to the email trigger. Likewise, if the training occurs virtually.



      However what I want to do is add an AND statement that says if the attendance type is "VIRTUALLY" AND the webinar link in column H is "Hosted in Blackboard" then the output should be a new value called "BLACKBOARDSEND".



      The code I've used so far only results in the error "Wrong number of arguments to IF. Expected between 2 and 3 arguments, but got 4 arguments."



      =IF($E2="","",IF($G2="IN PERSON","PERSONSEND",IF($G2="VIRTUALLY","VIRTUALSEND","",IF(AND($G2="IN PERSON", $H2="Hosted in Blackboard","BLACKBOARDSEND","")))))



      Test sheet link included: https://docs.google.com/spreadsheets/d/1RK4-KDlCctg49RK05voVb-COmk_7gZYHmk7gYbK-pMo/edit?usp=sharing







      if-statement google-sheets nested-loops






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 13 '18 at 20:25









      Alexandra CheathamAlexandra Cheatham

      32




      32






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Please try:



          =IF($E2="","",IF(AND($G2="IN PERSON",$H2="Hosted in Blackboard"),"BLACKBOARDSEND",IF($G2="VIRTUALLY","VIRTUALSEND",if($G2="IN PERSON","PERSONSEND",""))))


          You have quite a lot wrong so I suggest you study the above (if it suits you!).






          share|improve this answer























          • I had a feeling! I'm working with code someone else put together but I'm not quite familiar enough with the script to really know what's going wrong. That worked though, thank you!

            – Alexandra Cheatham
            Nov 13 '18 at 20:52











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53288964%2fnested-if-and-statements-in-google-sheets%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Please try:



          =IF($E2="","",IF(AND($G2="IN PERSON",$H2="Hosted in Blackboard"),"BLACKBOARDSEND",IF($G2="VIRTUALLY","VIRTUALSEND",if($G2="IN PERSON","PERSONSEND",""))))


          You have quite a lot wrong so I suggest you study the above (if it suits you!).






          share|improve this answer























          • I had a feeling! I'm working with code someone else put together but I'm not quite familiar enough with the script to really know what's going wrong. That worked though, thank you!

            – Alexandra Cheatham
            Nov 13 '18 at 20:52
















          0














          Please try:



          =IF($E2="","",IF(AND($G2="IN PERSON",$H2="Hosted in Blackboard"),"BLACKBOARDSEND",IF($G2="VIRTUALLY","VIRTUALSEND",if($G2="IN PERSON","PERSONSEND",""))))


          You have quite a lot wrong so I suggest you study the above (if it suits you!).






          share|improve this answer























          • I had a feeling! I'm working with code someone else put together but I'm not quite familiar enough with the script to really know what's going wrong. That worked though, thank you!

            – Alexandra Cheatham
            Nov 13 '18 at 20:52














          0












          0








          0







          Please try:



          =IF($E2="","",IF(AND($G2="IN PERSON",$H2="Hosted in Blackboard"),"BLACKBOARDSEND",IF($G2="VIRTUALLY","VIRTUALSEND",if($G2="IN PERSON","PERSONSEND",""))))


          You have quite a lot wrong so I suggest you study the above (if it suits you!).






          share|improve this answer













          Please try:



          =IF($E2="","",IF(AND($G2="IN PERSON",$H2="Hosted in Blackboard"),"BLACKBOARDSEND",IF($G2="VIRTUALLY","VIRTUALSEND",if($G2="IN PERSON","PERSONSEND",""))))


          You have quite a lot wrong so I suggest you study the above (if it suits you!).







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 13 '18 at 20:49









          pnutspnuts

          48.5k76299




          48.5k76299












          • I had a feeling! I'm working with code someone else put together but I'm not quite familiar enough with the script to really know what's going wrong. That worked though, thank you!

            – Alexandra Cheatham
            Nov 13 '18 at 20:52


















          • I had a feeling! I'm working with code someone else put together but I'm not quite familiar enough with the script to really know what's going wrong. That worked though, thank you!

            – Alexandra Cheatham
            Nov 13 '18 at 20:52

















          I had a feeling! I'm working with code someone else put together but I'm not quite familiar enough with the script to really know what's going wrong. That worked though, thank you!

          – Alexandra Cheatham
          Nov 13 '18 at 20:52






          I had a feeling! I'm working with code someone else put together but I'm not quite familiar enough with the script to really know what's going wrong. That worked though, thank you!

          – Alexandra Cheatham
          Nov 13 '18 at 20:52




















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53288964%2fnested-if-and-statements-in-google-sheets%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Use pre created SQLite database for Android project in kotlin

          Darth Vader #20

          Ondo