cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional Formatting based on row value

SOLVED
EricKlasko
5 - Atom

Conditional Formatting based on row value

Hello Everyone,

 

I'm trying to color cell text in a table using a column rule. If the value in 2 rows is the same i would like the text colored green, if it is different then the text colored red. 

I've tried using this formula in the column rules but it just colors everything green : IF [RTO]=[RTO] Then "color:green" Else "color:red" ENDIF

 

 

Any assistance would be greatly appreciated. 

Thank you!

 

Conditional formatting.PNG

2 REPLIES 2
EricKlasko
5 - Atom

Conditional Formatting based on row value

Hello Everyone,

 

I'm trying to color cell text in a table using a column rule. If the value in 2 rows is the same i would like the text colored green, if it is different then the text colored red. 

I've tried using this formula in the column rules but it just colors everything green : IF [RTO]=[RTO] Then "color:green" Else "color:red" ENDIF

 

 

Any assistance would be greatly appreciated. 

Thank you!

 

Conditional formatting.PNG

BS_THE_ANALYST
15 - Aurora

Re: Conditional Formatting based on row value

Hi @EricKlasko

 

In your formula you say [RTO] = [RTO]. This checks if the value in a column is itself, which it always will be. What you're trying to say here is like: [RTO]=[RTO-1row] or "are all the values in this column the same?"

 

If it were me, I would create a "helper column". I would create a new column which is a Count Distinct on the number of values in the column of interest. I would then attach this column back to the main data with a join. You could then reference this column in your Table Rules i.e. if Count Distinct number > 1 then "red" else "green".

 

Attached an example workflow below, please tailor it to your needs:

My logic, for each city, if the RTO is all the same then green, if the RTO is not then red.

Screenshot 2025-04-03 203123.png

 

Example of rules

Screenshot 2025-04-03 212024.png

All the best,
BS

LinkedIN

Bulien
Attachment
Download this attachment
binu_acs
Polaris

Re: Conditional Formatting based on row value

@EricKlasko another way of doing this with the multi-row tool

image.png

Attachment
Download this attachment