How to ignore blank cells when stringing cell values together
Hi everyone!
Hoping someone can help me out. I have created a Smartsheet form that someone can fill out to create a custom URL. On the backend of the Smartsheet, I have a formula set up to string all the values together and add delimiters into a url string. It works great, with one exception.
All of the form fields are mandatory except for one. I need to add something into the function to remove a blank value from the final string if the cell for that value is blank.
My current set up is:
=([Website URL]11 + "?utm_medium=" + [Final Medium]11 + "&utm_source=" + [Final Source]11 + "&utm_campaign=" + Campaign11 + "&utm_term=" + Term11 + "&utm_content=" + Content11)
The field in question is "Term". So if the Term column has a blank value, I need it remove "&utm_term=" + Term11 from the final string.
Can someone help me out? Thanks!
Best Answer
-
Toufong Vang ✭✭✭✭✭
Hi, Scott.
Give this a try...
=([Website URL]11 + "?utm_medium=" + [Final Medium]11 + "&utm_source=" + [Final Source]11 + "&utm_campaign=" + Campaign11 + (IF(ISBLANK(Term11),"", "&utm_term=" + Term11)) + "&utm_content=" + Content11)
In your formula you had
"&utm_term=" + Term11
in betweenCampaign11 +
and+ "&utm_content="
Since you already have your logic defined,leave blank if Term11 is blank, form it between(...)and then insert that into your formula.
If term is blank
ISBLANK(Term11)
then use empty""
else use"&utm_term=" + Term11
( IF( ISBLANK(Term11), "", "&utm_term=" + Term11) )
Answers
-
Toufong Vang ✭✭✭✭✭
Hi, Scott.
Give this a try...
=([Website URL]11 + "?utm_medium=" + [Final Medium]11 + "&utm_source=" + [Final Source]11 + "&utm_campaign=" + Campaign11 + (IF(ISBLANK(Term11),"", "&utm_term=" + Term11)) + "&utm_content=" + Content11)
In your formula you had
"&utm_term=" + Term11
in betweenCampaign11 +
and+ "&utm_content="
Since you already have your logic defined,leave blank if Term11 is blank, form it between(...)and then insert that into your formula.
If term is blank
ISBLANK(Term11)
then use empty""
else use"&utm_term=" + Term11
( IF( ISBLANK(Term11), "", "&utm_term=" + Term11) )
-
Hi@TFC. This worked perfectly! Thanks so much for such a quick response!
-
Andrée Starå ✭✭✭✭✭✭
I hope you're well and safe!
增加交通的优秀建议/答案.
I'd recommend changing the row numbers to @row instead, so you don't have to think about the row numbers + you might be able to make it a so-called column formula.
Something like this.
=([Website URL]@row + "?utm_medium=" + [Final Medium]@row + "&utm_source=" + [Final Source]@row + "&utm_campaign=" +[email protected]+ (IF(ISBLANK([email protected]),"", "&utm_term=" +[email protected])) + "&utm_content=" +[email protected])
I hope that helps!
Be safe and have a fantastic week!
Best,
Andrée Starå| Workflow Consultant / CEO @WORK BOLD
✅Did my post(s) help or answer your question or solve your problem? Please support the Community bymarking it Insightful/Vote Up or/and as the accepted answer. It will make it easier for others to find a solution or help to answer!
SMARTSHEET EXPERT CONSULTANT & PARTNER
Andrée Starå| Workflow Consultant / CEO @WORK BOLD
W:www.workbold.com| E:[email protected]| P: +46 (0) - 72 - 510 99 35
Feel free to contact me about help with Smartsheet, integrations, general workflow advice, or something else entirely.
Help Article Resources
Categories
Check out theFormula Handbook template!
Try this:<\/p>
=AVG(COLLECT([Resolution Time (Days)]:[Resolution Time (Days)], [Date Closed]:[Date Closed], AND(@cell>DATE(2023, 6, 1), @cell<DATE(2023, 6, 30))))<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":254,"urlcode":"Formulas","name":"Formulas"}]},{"discussionID":108339,"type":"question","name":"Help on IF formula... validating two columns.","excerpt":"Hi, hope everyone is doing well? hoping someone could please help me with this formula, at the moment I am using the below formula to check the % from Score column and give the outcome result in the Result column and this is working fine, just wondering, if there a way I can include ‘Auto Fail’ in the above formula so if…","snippet":"Hi, hope everyone is doing well? hoping someone could please help me with this formula, at the moment I am using the below formula to check the % from Score column and give the…","categoryID":322,"dateInserted":"2023-08-01T11:55:34+00:00","dateUpdated":null,"dateLastComment":"2023-08-01T13:58:19+00:00","insertUserID":159253,"insertUser":{"userID":159253,"name":"ovelzone","url":"https:\/\/community.smartsheet.com\/profile\/ovelzone","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-01T16:27:58+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":45516,"lastUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-08-01T15:39:04+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":4,"countViews":23,"score":null,"hot":3381791633,"url":"https:\/\/community.smartsheet.com\/discussion\/108339\/help-on-if-formula-validating-two-columns","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/108339\/help-on-if-formula-validating-two-columns","format":"Rich","lastPost":{"discussionID":108339,"commentID":388190,"name":"Re: Help on IF formula... validating two columns.","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/388190#Comment_388190","dateInserted":"2023-08-01T13:58:19+00:00","insertUserID":45516,"insertUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-08-01T15:39:04+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"image":{"url":"https:\/\/us.v-cdn.net\/6031209\/uploads\/C0TNHS5393OE\/image.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"image.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-01T13:41:25+00:00","dateAnswered":"2023-08-01T12:08:16+00:00","acceptedAnswers":[{"commentID":388167,"body":"
Try this one:<\/p>
=IF([Autofail]@row = \"Y\", \"Auto Fail\", IF([Score]@row < 0.5, \"Fail\", IF(AND([Score]@row > 0.5, [Score]@row < 0.65), \"Pass\", IF(AND([Score]@row > 0.64, [Score]@row < 0.75), \"Credit\", IF(AND([Score]@row > 0.74, Score]@row < 0.85), \"Distinction\", IF(AND([Score]@row > 0.84, [Score]@row <= 1), \"High Distinction\"))))))<\/p>"},{"commentID":388172,"body":"
This should work for you:<\/p>
=IF(Autofail@row = \"Y\", \"Auto Fail\", IF(Score@row< 0.5, \"Fail\", IF(Score@row< 0.65, \"Pass\", IF(Score@row< 0.75, \"Credit\", IF(Score@row<0.85, \"Distinction\", \"High Distinction\")))))<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]},{"discussionID":108324,"type":"question","name":"Help with Conditional Formatting","excerpt":"I have to create a report that has conditional formatting onto it. I am not really sure how to work Smartsheet's conditional formatting stuff. The example I was given to create was: \"Can color be added based on calendar logic (0-30 days since xxx, for example)\" There is an active sheet that we would use to put the…","snippet":"I have to create a report that has conditional formatting onto it. I am not really sure how to work Smartsheet's conditional formatting stuff. The example I was given to create…","categoryID":322,"dateInserted":"2023-07-31T20:42:59+00:00","dateUpdated":null,"dateLastComment":"2023-08-01T15:15:48+00:00","insertUserID":162512,"insertUser":{"userID":162512,"name":"Hannahsamd","title":"Hannah","url":"https:\/\/community.smartsheet.com\/profile\/Hannahsamd","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-01T15:16:52+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"updateUserID":null,"lastUserID":45516,"lastUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-08-01T15:39:04+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":4,"countViews":34,"score":null,"hot":3381741527,"url":"https:\/\/community.smartsheet.com\/discussion\/108324\/help-with-conditional-formatting","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/108324\/help-with-conditional-formatting","format":"Rich","lastPost":{"discussionID":108324,"commentID":388218,"name":"Re: Help with Conditional Formatting","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/388218#Comment_388218","dateInserted":"2023-08-01T15:15:48+00:00","insertUserID":45516,"insertUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-08-01T15:39:04+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"image":{"url":"https:\/\/us.v-cdn.net\/6031209\/uploads\/Z4RH1R79HNAW\/image.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"image.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-01T15:17:55+00:00","dateAnswered":"2023-08-01T06:13:07+00:00","acceptedAnswers":[{"commentID":388141,"body":"