Conditional formating depending of another line

JMonicard
JMonicard ✭
edited 06/03/25 in Smartsheet Basics

Hi all,

I would like to know it there is any possibility to format a lign depending of the upper line.

Explanation :

I have a contact list of several suppliers, and can have several line for one suppliers.

My objective would be to change the color of the line if the supplier of the upper line is different (like in the exemple below)

image.png

Do you have any ideas ?

Thanks a lot in advance !

Best Answer

  • Christina09
    Christina09 Community Champion
    Answer βœ“

    Try to have a helper column with this formula:

    =MOD(MATCH([Company]@row, DISTINCT([Company]:[Company]), 0), 2)

    Then add conditional format that if it's 1, change the row to green.

    image.png image.png

Answers

  • Naeem Ejaz
    Naeem Ejaz ✭✭✭✭✭✭
    1. Select the rows you want to format.
    2. Go to the Conditional Formatting option in Smartsheet.
    3. Create a new rule with the condition that checks if the supplier name in the current row is different from the supplier name in the upper row.
    4. Set the formatting style (e.g., change the background color).

    PMO & Smartsheet Consultant

    naeemejaz@hotmail.com

    00923455332351

  • Many thanks for the reply. I saw what you mean, but this will work for a line. My idea was to have that each time that the supplier change automatically.

    Any idea?

  • meagans
    meagans ✭✭✭✭✭

    I don't think there's a simple solution to do what you're asking (conditional formatting when row #2 is different than row #1 in a specified column), but as a workaround, I recommend using different colors for each supplier (e.g. light green for A, light blue for B, light gray for C) - especially if the row order changes due to being sorted in different ways, this is a workaround that may be useful.

    Meagan Struman ⚑️

    "We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney

  • Darren Mullen
    Darren Mullen Community Champion

    @JMonicard @meagans suggestion is what I was thinking. However, IF you can guarantee that all the suppliers will be grouped together, then there are some other tricks you could use to alternate colors for every other supplier grouping.

    Darren Mullen - Looking to take your Smartsheet knowledge to the next level and become an expert? Join the Smartsheet Guru Elite

    Get my 7 Smartsheet tips here

    Author of: Smartsheet Architecture Solutions

  • @meagans : Thank you ! yes the thing is that will be a "moving" list. But you're right, we can color manually each supplier to alternate.

    @Darren Mullen : Yes, all suppliers will be grouped together even if we add lines, we will sort them to have suppliers grouped.

  • Christina09
    Christina09 Community Champion
    Answer βœ“

    Try to have a helper column with this formula:

    =MOD(MATCH([Company]@row, DISTINCT([Company]:[Company]), 0), 2)

    Then add conditional format that if it's 1, change the row to green.

    image.png image.png
  • Hello @Christina09 A big big thanks ! This is perfect !

    Thanks again !