conditional format on cells with result of formula

Bandito1

Board Regular
Joined
Oct 18, 2018
Messages
237
Office Version
  1. 2016
Platform
  1. Windows
Hi all,

Tried to look it up but couldn't find it, so i try it here.
I'm trying to give percentages a color.
Everything >0% should turn green
Everything <0% should turn red

It works when the percentage is small (like -0,65%). But when it's -2.56% for example it just turns green..

I used conditional format; Cell value <00.00 - red and other rule Cell value >00.00 green.

What is going wrong here?
 

Attachments

  • Conditional format.jpg
    Conditional format.jpg
    71.1 KB · Views: 9

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Use relative cell references instead of absolute references (remove the "$" from the cell reference).

1714709139755.png


Book4
G
22
3-0.2
40.025
5-1.5
6
7
8
9
10
11
12
13
14
15
16
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
G2:G16Expression=G2:G16>0textNO
G2:G16Expression=G2:G16<0textNO
 
Upvote 0
Conditional Formatting is quite a drain on performance. If that is all you are trying to do any reason you don't just use custom formatting ?
0.00%;[Red]-0.00%;0.00%
 
Upvote 0
Thanks for your reply

Is it possible with custom formatting to display everything above 0.00% green and everything below 0.00% red?

I tried 0,00%;[Red]-0,00%;0,00% in format cells -> custom but nothing changes
 
Upvote 0
That's odd. They are definitely numbers right ? ie if you change the format to General the display changes doesn't it.
Assuming it does have a look at the heading "Colors" in this article.
 
Upvote 0
What exactly is the formula in these cells that are calculating the percentages?
Can you please post it?

Are you, per chance, using the TEXT function in your formula?
If so, that is returning a TEXT value and not a numeric one, and formatting won't work on it.
 
Upvote 0
The data comes from a table with;
VBA Code:
=VLOOKUP(Table5[@Symbool];Table_0__2;4;FALSE)

Table 0 has stock market data that is imported from google sheets.
 
Upvote 0
Table 0 has stock market data that is imported from google sheets.
I am guessing that the field you are returning back may be a text field (numbers entered as text).
In order to get formatting to be applied, we need to convert it to numbers.

See if making this change to your formula does that:
Excel Formula:
=VLOOKUP(Table5[@Symbool];Table_0__2;4;FALSE) + 0
 
Upvote 0
When i make that change the percentage changes in number; 1,00% changes to 0,01.
I would like to see 1,00%
 
Upvote 0
When i make that change the percentage changes in number; 1,00% changes to 0,01.
I would like to see 1,00%
That is exactly correct. 1% = 0.01 (or 0,01 in your case).
Now that this value is numeric, you can now apply the Custom Format to the cell that were discussed in the earlier replies.
 
Upvote 0

Forum statistics

Threads
1,216,810
Messages
6,132,831
Members
449,761
Latest member
AUSSW

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top