Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditional Formattign in Excel

Is there any way to create a dynamic IF() statement within Excel that will color cells based on their sum. Thus I want a formula that simply states that is B1 - C1 > 0, Green(), Red(), and I want it applied to $B$1:$C$50. Is this possible? I am comparing the computed value for each row and  thus will color the cell accordingly.

Thanks for any and all help.

Best.

14 Replies
Not applicable
Author

I figured it out, if I want to compare the outcome of B1 - C1 for B1:C50, then within the Conditional Formatting Rules Manager you cannot hard code =($B$1-$C$1)<0, nor =($B$1:$B$50-$C$1:$C$50)<0, but rather =($B1-$C1) < 0, to keep the calculations in column $B and $C. This will then calculate B1 - C1 .......... B50 - C50, and if < 0, will format the cells RED, then you need to create an additional Rule that states  =($B1-$C1) >= 0, to format the cells GREEN.

Best

sinanozdemir
Specialist III
Specialist III

Just use VBA, please see below screenshot:

Capture.png

Not applicable
Author

no harm no foul

Not applicable
Author

Much easier, thanks mate

sinanozdemir
Specialist III
Specialist III

You are welcome.