Welcome to the Smartsheet Forum Archives


The posts in this forum are no longer monitored for accuracy and their content may no longer be current. If there's a discussion here that interests you and you'd like to find (or create) a more current version, pleaseVisit the Current Forums.

COUNTIF using Parent Rows Only

I am trying to come up with a formula that would count only the parents rows.

Comments

  • J. Craig Williams
    J. Craig Williams ✭✭✭✭✭✭

    Jill,

    A bit clarification please.

    All parents in a column?

    What about grand-parents, do they count?

    You may need to have a column determining if the row is a parent and then count that column instead.

    I was hoping something like this would work:

    =COUNTIF(Example:Example, COUNT(CHILDREN(@cell))> 0)

    but the second level of@cellusage seems to confuse it (#UNPARSEABLE).

    Craig

  • Brett Evans
    Brett Evans ✭✭✭✭✭✭

    Jill,

    I have been able to do that, but it took about 8 extra columns. It can handle grandparent, parent and child rows. My head started to hurt when adding another level.

    To Craig's question, what is the full use case that you are trying to achieve? The details can change the layout of this.

    -Brett

  • I am pretty new at this so bear with me a bit.

    I have a parent row that rolls up information based on dates in the children rows. I am wanting to have a count of the parent rows only for each set (based on the different information that is rolled up per set)

  • Shaine Greenwood
    Shaine Greenwood Employee
    edited 02/28/17

    Jill—

    One possibility would be to add a parent row at the top of your sheet and place a =COUNTIF(CHILDREN(), DATE(yyyy,mm,dd))

    You'd need to do a lot of indenting and doublechecking to make sure that your hierarchy is still in order.

    Otherwise, you can place the formula in another cell (where ever you'd like), and reference the parent cells:

    =COUNTIF(CHILDREN([Column Name]4), DATE(yyyy,mm,dd)) + COUNTIF(CHILDREN([Column Name]20), DATE(yyyy,mm,dd)) + etc...

    I'd recommend checking out our Creating Formulas article for details on function syntax in Smartsheet:https://help.smartsheet.com/articles/2476171-create-and-edit-formulas-in-smartsheet

    You can find our complete list of functions available in Smartsheet here:https://help.smartsheet.com/articles/775363-using-formulas

This discussion has been closed.
@Steve_Mitchell<\/a>, thank you! I just filed a ticket. i appreciate your help.<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":321,"name":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B","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":207,"urlcode":"Sales","name":"Sales"},{"tagID":281,"urlcode":"Support","name":"Support"},{"tagID":446,"urlcode":"update-requests","name":"Update Requests"}]},{"discussionID":106913,"type":"question","name":"SUMIF with a checkbox","excerpt":"I'm trying to sum a row of amounts (Parking Revenue Regular:Private boat parking revenue) into the column \"Total Parking Revenue\", but only if the checkbox \"Payment Voucher\" isn't checked. When I add the rows using this formula without the checkbox, it works (formula on first row only): =SUM([Parking Revenue…","categoryID":322,"dateInserted":"2023-06-26T18:20:45+00:00","dateUpdated":null,"dateLastComment":"2023-06-26T19:03:27+00:00","insertUserID":162776,"insertUser":{"userID":162776,"name":"declark","title":"Regional Director","url":"https:\/\/community.smartsheet.com\/profile\/declark","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!4cFWuLGjTPw!x-tXMZGznvw!Dlin9vWXHb9","dateLastActive":"2023-06-26T19:03:36+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":162776,"lastUser":{"userID":162776,"name":"declark","title":"Regional Director","url":"https:\/\/community.smartsheet.com\/profile\/declark","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!4cFWuLGjTPw!x-tXMZGznvw!Dlin9vWXHb9","dateLastActive":"2023-06-26T19:03:36+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":26,"score":null,"hot":3375611052,"url":"https:\/\/community.smartsheet.com\/discussion\/106913\/sumif-with-a-checkbox","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106913\/sumif-with-a-checkbox","format":"Rich","lastPost":{"discussionID":106913,"commentID":382400,"name":"Re: SUMIF with a checkbox","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/382400#Comment_382400","dateInserted":"2023-06-26T19:03:27+00:00","insertUserID":162776,"insertUser":{"userID":162776,"name":"declark","title":"Regional Director","url":"https:\/\/community.smartsheet.com\/profile\/declark","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!4cFWuLGjTPw!x-tXMZGznvw!Dlin9vWXHb9","dateLastActive":"2023-06-26T19:03:36+00:00","banned":0,"punished":0,"private":false,"label":"✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"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\/3KE67LQDZX4M\/image.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"image.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-26T19:03:34+00:00","dateAnswered":"2023-06-26T18:31:26+00:00","acceptedAnswers":[{"commentID":382384,"body":"

Try IF([payment voucher]@row=0,Sum([Parking Revenue Regular]@row:[Private boat parking revenue]@row),\"//www.santa-greenland.com/community/discussion/7449/\")<\/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":106894,"type":"question","name":"How to Count a value in a drop down \/ multi-selection list?","excerpt":"Hi, I'm wanting to count the total amount time this value \"VAVE\" is being assigned to a drop down column. I'm using a summary sheet to collect this data using formulas. So in the request type column(drop down list) I want the total in this sheet. I also want a total by the Brand. I keep getting an incorrect number, like 48…","categoryID":321,"dateInserted":"2023-06-26T15:09:07+00:00","dateUpdated":"2023-06-26T15:09:27+00:00","dateLastComment":"2023-06-26T20:54:24+00:00","insertUserID":162246,"insertUser":{"userID":162246,"name":"Shawn_K2","url":"https:\/\/community.smartsheet.com\/profile\/Shawn_K2","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!nPFlXyflhuI!uj8vZ9JIm_o!1axowkoO9t8","dateLastActive":"2023-06-26T20:56:17+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":162246,"lastUserID":116407,"lastUser":{"userID":116407,"name":"Darren Mullen","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Darren%20Mullen","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/9WIC1TB7AJQT\/nP1GU5H4ITA1P.png","dateLastActive":"2023-06-27T04:13:24+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":7,"countViews":54,"score":null,"hot":3375609211,"url":"https:\/\/community.smartsheet.com\/discussion\/106894\/how-to-count-a-value-in-a-drop-down-multi-selection-list","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106894\/how-to-count-a-value-in-a-drop-down-multi-selection-list","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":106894,"commentID":382446,"name":"Re: How to Count a value in a drop down \/ multi-selection list?","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/382446#Comment_382446","dateInserted":"2023-06-26T20:54:24+00:00","insertUserID":116407,"insertUser":{"userID":116407,"name":"Darren Mullen","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Darren%20Mullen","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/9WIC1TB7AJQT\/nP1GU5H4ITA1P.png","dateLastActive":"2023-06-27T04:13:24+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Using Smartsheet","url":"https:\/\/community.smartsheet.com\/categories\/using-smartsheet"},{"name":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B"}],"groupID":null,"statusID":3,"image":{"url":"https:\/\/us.v-cdn.net\/6031209\/uploads\/LKT88AUTSMAT\/image.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"image.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-26T16:54:33+00:00","dateAnswered":"2023-06-26T16:44:18+00:00","acceptedAnswers":[{"commentID":382355,"body":"

@Shawn_K2<\/a> UGH I make a mistake. I copied your formula without looking at it close enough 😜<\/span><\/p>


<\/p>

try =COUNTIFS({CPR Request Type}, HAS(@cell, \"VAVE\"))<\/p>"},{"commentID":382446,"body":"

@Shawn_K2<\/a> <\/p>

=COUNTIFS({CPR Request Type}, HAS(@cell, \"VAVE\"), {CPR Brand}, HAS(@cell, \"ING\"))<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":321,"name":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B","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&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&siteSectionID=0&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 Posts","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">

Trending Posts