Help with multiple IFERROR statements
Hi team - I have a sheet that has a "created" date that is auto generated. Now that we're into 2021 I need to differentiate 2021 vs 2020 months.
I used the following formula last year to get a count of something specific:
=COUNTIFS({(Source Data) Main row}, 1, {(Source Data) Exempt}, 0, {(Source Data) Created}, IFERROR(MONTH(@cell), 0) = 1)
But now that we're into 2021, how do I specify the same formula statement but include months with 2021 included?
Thanks,
Jeff
Best Answer
-
Mark Cronk ✭✭✭✭✭✭
Hi Jeff,
You got me curious enough to set up a test on my side. The formula works for me. I suspect you have an issue with one of your data ranges. I'd rebuild the formula and insert new ranges to confirm they are correct.
This is what worked for me. I can change the month, year or checkboxes and get the correct responses:
=COUNTIFS({(Source Data) Main row}, 1, {(Source Data) Exempt}, 0, {(Source Data) Created}, AND(IFERROR(MONTH(@cell), 0) = 1, IFERROR(YEAR(@Cell), 0)=2021))
{(Source Data) Main row} and {(Source Data) Exempt} need to be formatted as Checkbox columns. {(Source Data) Created} is a system generated Created column.
Good luck.
Mark
I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.
Answers
-
Mark Cronk ✭✭✭✭✭✭
Hi Jeff,
Try:
=COUNTIFS({(Source Data) Main row}, 1, {(Source Data) Exempt}, 0, {(Source Data) Created}, AND(IFERROR(MONTH(@cell), 0) = 1, YEAR(@Cell)=2021))
Mark
I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.
-
jmo ✭✭✭✭✭✭
@Mark Cronk- I get an UNPARSEABLE error when I copy/paste that in
-
Mark Cronk ✭✭✭✭✭✭
Hi Jeff,
Try this much and see if it works. =COUNTIFS({(Source Data) Main row}, 1, {(Source Data) Exempt}, 0)
如果是,问题是:{(源数据)创建d}, AND(IFERROR(MONTH(@cell), 0) = 1, YEAR(@Cell)=2021)
Let me know what you find.
Mark
I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.
-
jmo ✭✭✭✭✭✭
Hi@Mark Cronk- that portion worked by itself. Also, not sure if I was clear initially, but the full formula I used last year worked - all I had to do was change the MONTH number:
=COUNTIFS({(Source Data) Main row}, 1, {(Source Data) Exempt}, 0, {(Source Data) Created}, IFERROR(MONTH(@cell), 0) = 1)
So definitely a problem incorporating the AND(IFERROR(MONTH(@cell), 0) = 1, YEAR(@Cell)=2021) recommendation you provided.
Should that be written another way?
-
Mark Cronk ✭✭✭✭✭✭
Good morning,
The syntax in the formula I provided looks right but let's try this instead:
=COUNTIFS({(Source Data) Main row}, 1, {(Source Data) Exempt}, 0, {(Source Data) Created}, IFERROR(MONTH(@cell), 0) = 1, {(Source Data) Created}, IFERROR(YEAR(@Cell), 0)=2021)
To get 2021 results you need to insert the criteria YEAR(@cell)=2021, where the cell is the date created on your external reference.
Work this time?
Mark
I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.
-
jmo ✭✭✭✭✭✭
Hmm still unparseable
-
Mark Cronk ✭✭✭✭✭✭
Very strange. The formula looks right. Is your {(Source Data) Created} range formatted as a date column? Confirm all of the range names are correct in the formula.
Maybe someone else can spot the error or has an idea about the cause.
Mark
I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.
-
jmo ✭✭✭✭✭✭
Hi@Mark Cronk- it is definitely strange behavior. Yes, the (Source Data) Created) column is a system generated date column:
Here are some of the "source data" fields, to include the Created column:
-
Mark Cronk ✭✭✭✭✭✭
Hi Jeff,
You got me curious enough to set up a test on my side. The formula works for me. I suspect you have an issue with one of your data ranges. I'd rebuild the formula and insert new ranges to confirm they are correct.
This is what worked for me. I can change the month, year or checkboxes and get the correct responses:
=COUNTIFS({(Source Data) Main row}, 1, {(Source Data) Exempt}, 0, {(Source Data) Created}, AND(IFERROR(MONTH(@cell), 0) = 1, IFERROR(YEAR(@Cell), 0)=2021))
{(Source Data) Main row} and {(Source Data) Exempt} need to be formatted as Checkbox columns. {(Source Data) Created} is a system generated Created column.
Good luck.
Mark
I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.
-
jmo ✭✭✭✭✭✭
That last one worked,@Mark Cronk! I had to manually input the formula step by step - it didn't work when I copy/pasted.
Thanks for sticking this out with me!️
-
Mark Cronk ✭✭✭✭✭✭
Perfect. Glad you found a solution. Thanks for contributing to the Community.
Mark
I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.
Help Article Resources
Categories
Give this a try.<\/p>
=SUMIFS({Broker Report Test 2 Range 1}, {Broker Activity Report Range 6}, \"January\", {Broker Activity Report Range 1}, OR(@cell = \"EMORY DECATUR I\",@cell = \"EMORY DECATUR II\",@cell = \"EMORY DECATUR III\"))<\/p>
Hope this helps,<\/p>
Dave<\/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":111186,"type":"question","name":"Dividing to Create a %","excerpt":"I would like to use the data in Column A and B to create a percentage complete by row NOT by parent\/hierarchy. In Excel this would be =sum(Column B\/Column A) = %. What is the formula for Smartsheet?","snippet":"I would like to use the data in Column A and B to create a percentage complete by row NOT by parent\/hierarchy. In Excel this would be =sum(Column B\/Column A) = %. What is the…","categoryID":322,"dateInserted":"2023-10-04T15:20:08+00:00","dateUpdated":null,"dateLastComment":"2023-10-04T18:59:48+00:00","insertUserID":78761,"insertUser":{"userID":78761,"name":"tmkj20","url":"https:\/\/community.smartsheet.com\/profile\/tmkj20","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!gnPeZ7gLMjw!!EdcH89Wp7wc","dateLastActive":"2023-10-04T17:29:41+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-10-04T23:32:17+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":4,"countViews":29,"score":null,"hot":3392881196,"url":"https:\/\/community.smartsheet.com\/discussion\/111186\/dividing-to-create-a","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/111186\/dividing-to-create-a","format":"Rich","lastPost":{"discussionID":111186,"commentID":398450,"name":"Re: Dividing to Create a %","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/398450#Comment_398450","dateInserted":"2023-10-04T18:59: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-10-04T23:32:17+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,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-10-04T17:30:15+00:00","dateAnswered":"2023-10-04T16:17:20+00:00","acceptedAnswers":[{"commentID":398399,"body":"
You would just use<\/p>
=[Column B]@row \/ [Column A]@row <\/p>
<\/p>
EDIT: Then apply the percentage format to the column.<\/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":111167,"type":"question","name":"Looking to Countif a person's name is contained in a column that allows for multiple contacts.","excerpt":"=COUNTIFS({OTP Goals Project Lead}, CONTAINS(Contact@row)) the OTP Goals Project Lead is the sheet that has the column that is a contact list that allows for multiple contacts. If a person's name is contained in that column and it matches the name in the column on the metrics sheet called Contact - then I want it to count…","snippet":"=COUNTIFS({OTP Goals Project Lead}, CONTAINS(Contact@row)) the OTP Goals Project Lead is the sheet that has the column that is a contact list that allows for multiple contacts. If…","categoryID":322,"dateInserted":"2023-10-04T02:50:21+00:00","dateUpdated":null,"dateLastComment":"2023-10-04T13:57:49+00:00","insertUserID":131821,"insertUser":{"userID":131821,"name":"Melitta","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Melitta","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!7FjR-2zeSSY!zOlQs_Tjxjo!J3yyx3hqT9S","dateLastActive":"2023-10-04T22:02:21+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭"},"updateUserID":null,"lastUserID":8888,"lastUser":{"userID":8888,"name":"Andrée Starå","title":"Smartsheet Expert Consultant & Partner | Workflow Consultant \/ CEO @ WORK BOLD","url":"https:\/\/community.smartsheet.com\/profile\/Andr%C3%A9e%20Star%C3%A5","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/0PAU3GBYQLBT\/nXWM7QXGD6464.jpg","dateLastActive":"2023-10-04T20:21:49+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":33,"score":null,"hot":3392817490,"url":"https:\/\/community.smartsheet.com\/discussion\/111167\/looking-to-countif-a-persons-name-is-contained-in-a-column-that-allows-for-multiple-contacts","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/111167\/looking-to-countif-a-persons-name-is-contained-in-a-column-that-allows-for-multiple-contacts","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":111167,"commentID":398349,"name":"Re: Looking to Countif a person's name is contained in a column that allows for multiple contacts.","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/398349#Comment_398349","dateInserted":"2023-10-04T13:57:49+00:00","insertUserID":8888,"insertUser":{"userID":8888,"name":"Andrée Starå","title":"Smartsheet Expert Consultant & Partner | Workflow Consultant \/ CEO @ WORK BOLD","url":"https:\/\/community.smartsheet.com\/profile\/Andr%C3%A9e%20Star%C3%A5","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/0PAU3GBYQLBT\/nXWM7QXGD6464.jpg","dateLastActive":"2023-10-04T20:21:49+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,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-10-04T11:48:58+00:00","dateAnswered":"2023-10-04T09:06:57+00:00","acceptedAnswers":[{"commentID":398315,"body":"
Hi @Melitta<\/a> <\/p> I hope you're well and safe!<\/p> Try something like this.<\/p> =COUNTIFS({OTP Goals Project Lead}, CONTAINS(Contact@row,@cell)<\/p> Did that work\/help? <\/p> I hope that helps!<\/p> Be safe, and have a fantastic week!<\/p> Best,<\/p> Andrée Starå<\/strong><\/a> | Workflow Consultant \/ CEO @ WORK BOLD<\/strong><\/a><\/p> ✅Did my post(s) help or answer your question or solve your problem? Please support the Community by <\/em>marking it Insightful\/Vote Up, Awesome, or\/and as the accepted answer<\/em><\/strong>. It will make it easier for others to find a solution or help to answer!<\/em><\/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"}]}],"initialPaging":{"nextURL":"https:\/\/community.smartsheet.com\/api\/v2\/discussions?page=2&categoryID=322&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&sort=-hot&limit=3&expand%5B0%5D=all&expand%5B1%5D=-body&expand%5B2%5D=insertUser&expand%5B3%5D=lastUser&status=accepted","prevURL":null,"currentPage":1,"total":10000,"limit":3},"title":"Trending in Formulas and Functions ","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">