Nested IF/AND Statements in Google Sheets
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
add a comment |
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
add a comment |
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
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
if-statement google-sheets nested-loops
asked Nov 13 '18 at 20:25
Alexandra CheathamAlexandra Cheatham
32
32
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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!).
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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!).
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
add a comment |
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!).
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
add a comment |
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!).
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!).
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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