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, please Visit the Current Forums.

Count specific list items in child

JD Ridenour
edited 12/09/19 in Archived 2015 Posts

I have a list of reports being sent to specific users as seen here:

 

Location 1

   - User 1                                                  xxxxxx

   --                              Report 1              Monday

   --                              Report 2             Thursday

   --                              Report 3             Daily

 

 

In the "xxxxxxx" cell, I'd like something like this: M:2 T:0 W:0 T:2 F:0

to let me know at a glance how many reports someone is getting on daily basis. I can't spread the sheet out to use check boxes, it all needs to be in 1 cell. Is there a way to add just each instance of Monday and Daily, and use a concatenate formula to put it together as seen?

Tags:

Comments

  • Travis
    Travis Employee

    This can be done using COUNTIF and concatenate functions. 

     

    Here is the formula. If XXXXXX is located in a parent row and Report 1, Report 2, etc are child rows, you can copy and paste this exact formula to your sheet. If you are not using hierarchies, you will need to replace all the CHILDREN() functions with cell ranges. 

     

    This formula counts the number of time each day appears + if daily appears, adds them together and concatenates it with text. 

     

    ="M:" + (COUNTIF(CHILDREN(), "Monday") + (COUNTIF(CHILDREN(), "Daily"))) + " T:" + (COUNTIF(CHILDREN(), "Tuesday") + (COUNTIF(CHILDREN(), "Daily"))) + " W:" + (COUNTIF(CHILDREN(), "Wednesday") + (COUNTIF(CHILDREN(), "Daily"))) + " T:" + (COUNTIF(CHILDREN(), "Thursday") + (COUNTIF(CHILDREN(), "Daily"))) + " F:" + (COUNTIF(CHILDREN(), "Friday") + (COUNTIF(CHILDREN(), "Daily")))

     

    The result is (using your example): M:2 T:1 W:1 T:2 F:1

     

    Learn more about formulas in Smartsheet through our Help Center page: http://help.smartsheet.com/customer/portal/articles/775363-using-formulas

  • JD Ridenour
    edited 09/01/15

    Oh, wow, that's perfect! Thanks a lot!

This discussion has been closed.