Formatting all Indented rows

Scott Rae
Scott Rae ✭✭✭✭
edited 12/09/19 in Smartsheet Basics

Hi,

Is there a way that I can change the colour of all cells in Indented rows rather than going thought them all one-by-one?

Cheers

Best Answer

  • Nate F
    Nate F ✭✭
    edited 02/21/25 Answer ✓

    I found this thread by searching for conditional formatting by indent level, and a previous comment at the moment says try this:

    =IF(COUNT(CHILDREN([Task Name]@row))  > 0), COUNT(ANCESTORS()) + 1)
    That gives me an error, and appears to have wrong syntax for something, maybe in getting a count of ancestors? I don't understand it well enough yet to know why it errors. And I have no idea what the +1 is for.

    My findings

    This function will simply return the current row's indent level - ANCESTORS appears to be a list/array counting cells (values?) in the current column.
    =COUNT(ANCESTORS())

    But it will look at the column it's in, so instead, I'd rather point it to something that "is a row in use" if and only if that column is populated, such as a primary column, here called Task Name…
    COUNT(ANCESTORS([Task Name]@row))

    And if you only care to know the indent level if there are any children, this is what I'm using:
    =IF(COUNT(CHILDREN([Task Name]@row)) > 0, COUNT(ANCESTORS([Task Name]@row)), "")

    Hope this helps someone who was as confused as I was.

Answers