Count file names only

Options

I'm trying to create a unique ID for documents. I would like to generate a unique number for each Category (in "Abv") but I'm struggling to not count the parent rows.

My current formula is: =SUM(COUNTIFS(Auto:Auto, <Auto@row, Abr:Abr, Abr@row) + COUNTIFS(Auto:Auto, Auto@row, Abr:Abr, Abr@row))

The formula abode had been in "Count" but was counting the green and bolded rows too (which are folders, not files). In the yellow box is manually keyed in how I'd like the formula to create the numbering so the "New Document #" column will produce a unique number that starts at 1 for each Category eg. "MO", "SE"


Tags:

Best Answer

  • Mark Cronk
    Mark Cronk ✭✭✭✭✭✭
    Answer ✓
    Options

    Good afternoon, You could add a helper column to flag or a checkbox parent rows. Then use a COUNTIFS() that contains the helper column criteria -- Helper:Helper, =0

    Mark


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

Answers

  • Mark Cronk
    Mark Cronk ✭✭✭✭✭✭
    Answer ✓
    Options

    Good afternoon, You could add a helper column to flag or a checkbox parent rows. Then use a COUNTIFS() that contains the helper column criteria -- Helper:Helper, =0

    Mark


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

  • Adrienne Van Halem
    Options

    Thanks so much! I added a helper column with =IF(COUNT(CHILDREN()) > 0, 1, 0)

    and then changed my Count column to be

    =SUM(COUNTIFS(Auto:Auto, <Auto@row, Abr:Abr, Abr@row, [Helper2]:[Helper2], =0) + COUNTIFS(Auto:Auto, Auto@row, Abr:Abr, Abr@row))

    It still returns a 1 on the Parent folders but my statement in the Doc # column just doesn't return it.

  • Mark Cronk
    Mark Cronk ✭✭✭✭✭✭
    Options

    Hi again @Adrienne Van Halem,

    In your count column try:

    =if(Helper2@row=1,"", COUNTIFS($[Abr]$1:[Abr]@row, =[Abr]@row, $[helper2]$1:[helper]@row, =0))

    Your helper2 formula should be =IF(Count(Children())>0,1,0)

    Your count column should return a series of numbers starting with 1 for each Abr category (MO & SE).

    Work?

    Mark


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

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!