formula help again

Jason Jordan
Jason Jordan ✭✭✭✭

Hi again...

I'm looking to count checked check boxes by the person who completed them based of a date previous month.

i have 6 check box columns labled CPT1 Approved, CPT2 Approved, CPT3 Approved, CPT4 Approved, CPT5 Approved, CPT6 Approved.

One column name CPT 1-6 completed by column

One Closed date column.


I'd like to count the checked boxes based of the person in the "CPT1-6 completed by" column for the previous month. I've been successful in getting the individual counts without the other columns for example counting check marks =(COUNTIFS([CPT1 Approved]:[CPT6 Approved], 1)). counting the number of times a name shows up =COUNTIFS([CPT 1-6 completed by]:[CPT 1-6 completed by], ="Christi Gray") but I can't figure out how to combine them to get me the count just for that person for the previous month. I have not tried any formula for the previous month yet because I can't get the above to work first. I'm doing this in a sheet summary.

I've tried several combinations of count/if/s, if and/or statements that I've found in the community but nothing seems to work please help.

Thank you in advance

image.png


Best Answer

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    Answer ✓

    The problem here is that the way you have it written, all columns must be checked for it to count. If you want to count individual columns, you will need to write out multiple COUNTIFS (one for each checkbox column) and add them all together.

    =COUNTIFS([Closed date]:[Closed date], AND(IFERROR(MONTH(@cell), 0) = IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) - 1), IFERROR(YEAR(@cell), 0) = IF(MONTH(TODAY()) = 1, YEAR(TODAY()) - 1, YEAR(TODAY()))),[CPT1 Approved]:[CPT1 Approved], 1, [CPT 1-6 completed by]:[CPT 1-6 completed by], ="Christi Gray")


    +


    COUNTIFS([Closed date]:[Closed date], AND(IFERROR(MONTH(@cell), 0) = IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) - 1), IFERROR(YEAR(@cell), 0) = IF(MONTH(TODAY()) = 1, YEAR(TODAY()) - 1, YEAR(TODAY()))),[CPT2 Approved]:[CPT2 Approved], 1, [CPT 1-6 completed by]:[CPT 1-6 completed by], ="Christi Gray")


    +


    COUNTIFS([Closed date]:[Closed date], AND(IFERROR(MONTH(@cell), 0) = IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) - 1), IFERROR(YEAR(@cell), 0) = IF(MONTH(TODAY()) = 1, YEAR(TODAY()) - 1, YEAR(TODAY()))),[CPT3批准]:[CPT3批准), 1, [CPT 1-6 completed by]:[CPT 1-6 completed by], ="Christi Gray")


    so on and so forth so that it looks more like this...

    =COUNTIFS([Closed date]:[Closed date], AND(IFERROR(MONTH(@cell), 0) = IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) - 1), IFERROR(YEAR(@cell), 0) = IF(MONTH(TODAY()) = 1, YEAR(TODAY()) - 1, YEAR(TODAY()))),[CPT1 Approved]:[CPT1 Approved], 1, [CPT 1-6 completed by]:[CPT 1-6 completed by], ="Christi Gray") + COUNTIFS([Closed date]:[Closed date], AND(IFERROR(MONTH(@cell), 0) = IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) - 1), IFERROR(YEAR(@cell), 0) = IF(MONTH(TODAY()) = 1, YEAR(TODAY()) - 1, YEAR(TODAY()))),[CPT2 Approved]:[CPT2 Approved], 1, [CPT 1-6 completed by]:[CPT 1-6 completed by], ="Christi Gray") + COUNTIFS([Closed date]:[Closed date], AND(IFERROR(MONTH(@cell), 0) = IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) - 1), IFERROR(YEAR(@cell), 0) = IF(MONTH(TODAY()) = 1, YEAR(TODAY()) - 1, YEAR(TODAY()))),[CPT3批准]:[CPT3批准), 1, [CPT 1-6 completed by]:[CPT 1-6 completed by], ="Christi Gray")



    Obviously this can turn into a crazy long formula. My suggestion would be to insert a column that adds up how many boxes are checked on each row and then use a SUMIFS to grab this column.


    =COUNTIFS([CPT1 Approved]@row:[CPT6 Approved]@row, @cell = 1)


    Then in the summary field:

    =条件求和([Helper Column]:[Helper Column], [Closed date]:[Closed date], AND(IFERROR(MONTH(@cell), 0) = IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) - 1), IFERROR(YEAR(@cell), 0) = IF(MONTH(TODAY()) = 1, YEAR(TODAY()) - 1, YEAR(TODAY()))), [CPT 1-6 completed by]:[CPT 1-6 completed by], ="Christi Gray")

Answers

  • Mark Cronk
    Mark Cronk ✭✭✭✭✭✭

    Hi,

    Try:

    =(COUNTIFS([CPT1 Approved]:[CPT6 Approved], 1, [CPT 1-6 completed by]:[CPT 1-6 completed by], ="Christi Gray", [closed date]:[closed date], month(@cell)=month(today())-1)

    Work?

    Mark


    I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.

  • Jason Jordan
    Jason Jordan ✭✭✭✭

    @Mark CronkI'm getting #incorrect Argument Set with that formula.

  • Jason Jordan
    Jason Jordan ✭✭✭✭

    @Mark Cronki read about adding an IFERROR now i'm getting the unparseable error =(COUNTIFS([CPT1 Approved]:[CPT6 Approved], 1, [CPT 1-6 completed by]:[CPT 1-6 completed by], ="Christi Gray", ([Closed date]:[Closed date], IFERROR(MONTH(@cell) = MONTH(TODAY()) - 1)))

    I read that if the date columns are blank it messes it up and adding the IFERROR before the month it would fix it. but now I'm getting UNPARSEABLE.

  • Jason Jordan
    Jason Jordan ✭✭✭✭

    =COUNTIFS([CPT1 Approved]:[CPT6 Approved], 1, [CPT 1-6 completed by]:[CPT 1-6 completed by], ="Christi Gray", [Closed date]:[Closed date] AND(IFERROR(MONTH(@cell), 0) = IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) - 1), IFERROR(YEAR(@cell), 0) = IF(MONTH(TODAY()) = 1, YEAR(TODAY()) - 1, YEAR(TODAY()))))


    I found a formula for date that@Paul Newcomecreated that I think I need to account for year and December. I plugged it in but I'm still getting unparseable.

  • Jason Jordan
    Jason Jordan ✭✭✭✭
    edited 08/13/21

    Okay I've gotten all of them to work on their own in summary, now how do I combine them in one summary field to get the desired result for one staff member?

    =COUNTIFS([Closed date]:[Closed date], AND(IFERROR(MONTH(@cell), 0) = IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) - 1), IFERROR(YEAR(@cell), 0) = IF(MONTH(TODAY()) = 1, YEAR(TODAY()) - 1, YEAR(TODAY()))))

    =COUNTIFS([CPT1 Approved]:[CPT6 Approved], 1)

    =COUNTIFS([CPT 1-6 completed by]:[CPT 1-6 completed by], ="Christi Gray")

  • Jason Jordan
    Jason Jordan ✭✭✭✭

    Okay I'm getting there - now I've gotten it to work with the exception that my formula is returning when all six are checked instead of counting each check individually.. how can I make it so it will count each check individually.

    with the below I'm getting 1 when all 6 boxes are checked and if i uncheck one the count goes to zero.

    thank you in advance - Anyone? Marco?

    =COUNTIFS([Closed date]:[Closed date], AND(IFERROR(MONTH(@cell), 0) = IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) - 1), IFERROR(YEAR(@cell), 0) = IF(MONTH(TODAY()) = 1, YEAR(TODAY()) - 1, YEAR(TODAY()))), [CPT1 Approved]:[CPT1 Approved], 1, [CPT2 Approved]:[CPT2 Approved], 1, [CPT3 Approved]:[CPT3 Approved], 1, [CPT4 Approved]:[CPT4 Approved], 1, [CPT5 approved]:[CPT5 approved], 1, [CPT6 Approved]:[CPT6 Approved], 1, [CPT 1-6 completed by]:[CPT 1-6 completed by], ="Christi Gray")

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    Answer ✓

    The problem here is that the way you have it written, all columns must be checked for it to count. If you want to count individual columns, you will need to write out multiple COUNTIFS (one for each checkbox column) and add them all together.

    =COUNTIFS([Closed date]:[Closed date], AND(IFERROR(MONTH(@cell), 0) = IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) - 1), IFERROR(YEAR(@cell), 0) = IF(MONTH(TODAY()) = 1, YEAR(TODAY()) - 1, YEAR(TODAY()))),[CPT1 Approved]:[CPT1 Approved], 1, [CPT 1-6 completed by]:[CPT 1-6 completed by], ="Christi Gray")


    +


    COUNTIFS([Closed date]:[Closed date], AND(IFERROR(MONTH(@cell), 0) = IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) - 1), IFERROR(YEAR(@cell), 0) = IF(MONTH(TODAY()) = 1, YEAR(TODAY()) - 1, YEAR(TODAY()))),[CPT2 Approved]:[CPT2 Approved], 1, [CPT 1-6 completed by]:[CPT 1-6 completed by], ="Christi Gray")


    +


    COUNTIFS([Closed date]:[Closed date], AND(IFERROR(MONTH(@cell), 0) = IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) - 1), IFERROR(YEAR(@cell), 0) = IF(MONTH(TODAY()) = 1, YEAR(TODAY()) - 1, YEAR(TODAY()))),[CPT3批准]:[CPT3批准), 1, [CPT 1-6 completed by]:[CPT 1-6 completed by], ="Christi Gray")


    so on and so forth so that it looks more like this...

    =COUNTIFS([Closed date]:[Closed date], AND(IFERROR(MONTH(@cell), 0) = IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) - 1), IFERROR(YEAR(@cell), 0) = IF(MONTH(TODAY()) = 1, YEAR(TODAY()) - 1, YEAR(TODAY()))),[CPT1 Approved]:[CPT1 Approved], 1, [CPT 1-6 completed by]:[CPT 1-6 completed by], ="Christi Gray") + COUNTIFS([Closed date]:[Closed date], AND(IFERROR(MONTH(@cell), 0) = IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) - 1), IFERROR(YEAR(@cell), 0) = IF(MONTH(TODAY()) = 1, YEAR(TODAY()) - 1, YEAR(TODAY()))),[CPT2 Approved]:[CPT2 Approved], 1, [CPT 1-6 completed by]:[CPT 1-6 completed by], ="Christi Gray") + COUNTIFS([Closed date]:[Closed date], AND(IFERROR(MONTH(@cell), 0) = IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) - 1), IFERROR(YEAR(@cell), 0) = IF(MONTH(TODAY()) = 1, YEAR(TODAY()) - 1, YEAR(TODAY()))),[CPT3批准]:[CPT3批准), 1, [CPT 1-6 completed by]:[CPT 1-6 completed by], ="Christi Gray")



    Obviously this can turn into a crazy long formula. My suggestion would be to insert a column that adds up how many boxes are checked on each row and then use a SUMIFS to grab this column.


    =COUNTIFS([CPT1 Approved]@row:[CPT6 Approved]@row, @cell = 1)


    Then in the summary field:

    =条件求和([Helper Column]:[Helper Column], [Closed date]:[Closed date], AND(IFERROR(MONTH(@cell), 0) = IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) - 1), IFERROR(YEAR(@cell), 0) = IF(MONTH(TODAY()) = 1, YEAR(TODAY()) - 1, YEAR(TODAY()))), [CPT 1-6 completed by]:[CPT 1-6 completed by], ="Christi Gray")

  • Jason Jordan
    Jason Jordan ✭✭✭✭

    @Paul Newcomethank you! I didn't think about a helper column again.. got lost in my own head. worked perfectly!

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
Hi @Matthew Drake<\/a> <\/p>

There currently isn't a way to overlay an Outlook Calendar on top of a Smartsheet Calendar; you can do the reverse, publish dates from Smartsheet into Outlook.<\/a><\/p>

Please provide your feedback to the Product team through this form, here.<\/a><\/p>

Thanks,<\/p>

Genevieve<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":343,"name":"Add Ons and Integrations","url":"https:\/\/community.smartsheet.com\/categories\/apps-and-integrations","allowedDiscussionTypes":["discussion","question"]},"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":91824,"type":"question","name":"Dynamic View - Dropdown Lists","excerpt":"I have certain single and multiple select list columns that do not have the \"restrict to dropdown values only\" checked on the source sheet but in Dynamic View we are unable to add in our own values if they don't exist in the dropdown. This has been extremely frustrating especially when trying to capture new values and…","snippet":"I have certain single and multiple select list columns that do not have the \"restrict to dropdown values only\" checked on the source sheet but in Dynamic View we are unable to add…","categoryID":343,"dateInserted":"2022-06-06T17:24:20+00:00","dateUpdated":"2022-06-14T14:39:36+00:00","dateLastComment":"2023-08-25T19:03:11+00:00","insertUserID":113932,"insertUser":{"userID":113932,"name":"Emmy Anderson","url":"https:\/\/community.smartsheet.com\/profile\/Emmy%20Anderson","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!jplUI_CI3bw!8o9VN1d3-no!6TkM7ozjpN6","dateLastActive":"2023-05-04T14:55:16+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭"},"updateUserID":91566,"lastUserID":156788,"lastUser":{"userID":156788,"name":"Chris Broughton","url":"https:\/\/community.smartsheet.com\/profile\/Chris%20Broughton","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!p0HeqRqVoXw!8_nRN9ijwLw!lUie_n6pld_","dateLastActive":"2023-08-25T18:59:04+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":7,"countViews":566,"score":null,"hot":3347530651,"url":"https:\/\/community.smartsheet.com\/discussion\/91824\/dynamic-view-dropdown-lists","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/91824\/dynamic-view-dropdown-lists","format":"Rich","tagIDs":[319],"lastPost":{"discussionID":91824,"commentID":392652,"name":"Re: Dynamic View - Dropdown Lists","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/392652#Comment_392652","dateInserted":"2023-08-25T19:03:11+00:00","insertUserID":156788,"insertUser":{"userID":156788,"name":"Chris Broughton","url":"https:\/\/community.smartsheet.com\/profile\/Chris%20Broughton","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!p0HeqRqVoXw!8_nRN9ijwLw!lUie_n6pld_","dateLastActive":"2023-08-25T18:59: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":"Add Ons and Integrations","url":"https:\/\/community.smartsheet.com\/categories\/apps-and-integrations"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2022-06-08T12:36:40+00:00","dateAnswered":"2022-06-06T18:38:56+00:00","acceptedAnswers":[{"commentID":332119,"body":"

Hi @Emmy Anderson<\/a> <\/p>

You are not missing anything. This is how DV works with dropdowns unfortunately. My work around in the past is to create an other option in the drop down, user chooses save. Then have logic built for a text field that appears so the user can input the values not present in dropdown. <\/p>

Hope this helps<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":343,"name":"Add Ons and Integrations","url":"https:\/\/community.smartsheet.com\/categories\/apps-and-integrations","allowedDiscussionTypes":["discussion","question"]},"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":319,"urlcode":"functionality","name":"functionality"}]},{"discussionID":66594,"type":"question","name":"Is there a way to use OR in a Dynamic View filter condition?","excerpt":"In a View, I can create a custom filter that selects where the Project Lead is \"Mike\" but I want to also say \"OR Debbie.\" Is that possible? It looks like I can only choose AND.","snippet":"In a View, I can create a custom filter that selects where the Project Lead is \"Mike\" but I want to also say \"OR Debbie.\" Is that possible? It looks like I can only choose AND.","categoryID":343,"dateInserted":"2020-03-09T22:27:57+00:00","dateUpdated":"2022-06-14T14:36:49+00:00","dateLastComment":"2023-08-23T08:56:50+00:00","insertUserID":34501,"insertUser":{"userID":34501,"name":"MikeChambers","url":"https:\/\/community.smartsheet.com\/profile\/MikeChambers","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/CT5AV825MQ3E\/nG12D47VYRO8A.jpg","dateLastActive":"2023-03-05T01:19:05+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"updateUserID":91566,"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-08-26T17:06:33+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":9,"countViews":438,"score":null,"hot":3276579287,"url":"https:\/\/community.smartsheet.com\/discussion\/66594\/is-there-a-way-to-use-or-in-a-dynamic-view-filter-condition","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/66594\/is-there-a-way-to-use-or-in-a-dynamic-view-filter-condition","format":"rich","lastPost":{"discussionID":66594,"commentID":392055,"name":"Re: Is there a way to use OR in a Dynamic View filter condition?","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/392055#Comment_392055","dateInserted":"2023-08-23T08:56:50+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-08-26T17:06:33+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":"Add Ons and Integrations","url":"https:\/\/community.smartsheet.com\/categories\/apps-and-integrations"}],"groupID":null,"statusID":3,"image":{"url":"https:\/\/us.v-cdn.net\/6031209\/uploads\/814\/KBHVAAPJ5RYA.jpg","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"OR.jpg"},"attributes":{"question":{"status":"accepted","dateAccepted":"2020-03-12T17:06:46+00:00","dateAnswered":"2020-03-12T13:01:18+00:00","acceptedAnswers":[{"commentID":242817,"body":"

You are more than welcome!<\/p>

Glad to hear that it worked for your present use-case. <\/p>

Remember! <\/strong>Did my post help or answer your question or solve your problem? Please help the Community by <\/em>marking it as the accepted answer\/helpful<\/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":343,"name":"Add Ons and Integrations","url":"https:\/\/community.smartsheet.com\/categories\/apps-and-integrations","allowedDiscussionTypes":["discussion","question"]},"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":[]}],"initialPaging":{"nextURL":"https:\/\/community.smartsheet.com\/api\/v2\/discussions?page=2&categoryID=343&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&sort=-dateLastComment&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":643,"limit":3},"title":"Trending Posts","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">

Trending Posts