Conditional Formatting Query in Google Sheets

How can Sheets automatically display a custom label or color for the higher value among two paired cells? For instance:

=SWITCH(TRUE, D2 > E2, "Crimson", TRUE, "Azure")

Is this feature achievable?

hey, yes it´s possible. try using a custom formatting rule with a formula like =d2>e2 to color the higher value cell. sometimes a nested if added to the cell itself can provide the label u need

In my experience, achieving this involves a mix of conditional formatting rules and cell formulas. One approach is to create two rules: one assigning a specific format for D greater than E, and the other for the reverse. This isn’t done with a single cell formula, rather it requires setting up both conditions in the formatting menu. Alternatively, for custom labels, a helper cell using an IF statement can compare the two cells and output the appropriate text. Each method has its benefits depending on whether color or text is the priority.