Conditional formatting on returned value

finalfrontier1976

New Member
Joined
Jun 13, 2018
Messages
4
Hi,

I have an issue trying to get a conditional formatting set up on returned values from formulas. I have a worksheet with formulas in it that return values from another worksheet in the same workbook. I want to keep the formulas in the cells but impose a CF based on the value of the percentage that the formulas are bringing back.

For example, if he returned value is between 0% and 5% then fill the cell green.

So far no success.

Any ideas out there?
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Welcome to the Board!

Conditional Formatting does not care whether or not the values in the cells are hard-coded, or returned by formula. It makes no difference.
So, if it is not working, there is probably an issue either with the data it is returning, or your Conditional Formatting rules.

Is the data that the formula returning actually numeric, or numbers formatted as text?
Usually a dead giveaway is how the data is appearing in the cells. If it is left-justified, it is probably text. If it is right-justified, it is probably numeric.
The format of this data will impact how you need to create your Conditional Formatting rules.

To that point, please also post the Conditional Formatting rule that you have set-up.
 
Upvote 0
Welcome to the Board!

Conditional Formatting does not care whether or not the values in the cells are hard-coded, or returned by formula. It makes no difference.
So, if it is not working, there is probably an issue either with the data it is returning, or your Conditional Formatting rules.

Is the data that the formula returning actually numeric, or numbers formatted as text?
Usually a dead giveaway is how the data is appearing in the cells. If it is left-justified, it is probably text. If it is right-justified, it is probably numeric.
The format of this data will impact how you need to create your Conditional Formatting rules.

To that point, please also post the Conditional Formatting rule that you have set-up.


Hi,

I took out all he CF rules and tried to apply it again using this:

Cell value between 0 and 5

The returned data are percentages, the cells themselves are set to general and is left justified.
 
Upvote 0
Cell value between 0 and 5
This is your problem right here.

Percentages are fractions of 1 (where 100% actually equals 1).

So you either need to do:
Cell value between 0 and .05
or
Cell value between 0 and 5%
 
Last edited:
Upvote 0
The returned data are percentages, the cells themselves are set to general and is left justified.
Whoops, I overlooked that part in your last reply.
That seems to suggest that you are pulling back text, not numbers.
What exactly is the formula in the cell that you are applying the Conditional Formatting to?

And the cell that the formula is pulling from, is that hard-coded or a formula (if a formula, please post that formula too)?
Is the data left or right justified in that cell?
 
Upvote 0
Whoops, I overlooked that part in your last reply.
That seems to suggest that you are pulling back text, not numbers.
What exactly is the formula in the cell that you are applying the Conditional Formatting to?

And the cell that the formula is pulling from, is that hard-coded or a formula (if a formula, please post that formula too)?
Is the data left or right justified in that cell?

Ok, the returned formula is (the one I'm trying to CF): =IFERROR(VLOOKUP($A12,INDIRECT("'"&B$11&"'!A:F"),6,FALSE),"")
It's left justified on return automatically not set in the ribbon.

The source figure did say it was formatted as text but I converted it to a number and it's purely a percentage like 4.76% no formula and it's centred.
 
Upvote 0
it's centred
If it is centered, it probably has custom justification set on that cell. If you remove it so it goes back to the default, I am guessing it will be left-justified.
Just to confirm that, you can use the ISNUMBER function to check:
=ISNUMBER(F6)
If it returns FALSE, it is not a number, so numeric functions will not work on it (like >, <, between, etc).

So we have a few choices:
- Convert the source data to numeric (can be done easily with Text to Columns)
- Change your Conditional Formatting rules to convert the values it is check to numbers (in which case, you would have to use the "Formula" options)
- Update your formula to convert the value it is bringing back to a number, like this:
Code:
[COLOR=#333333]=IFERROR([/COLOR][COLOR=#ff0000][B]VALUE([/B][/COLOR][COLOR=#333333]VLOOKUP($A12,INDIRECT("'"&B$11&"'!A:F"),6,FALSE)[/COLOR][B][COLOR=#ff0000])[/COLOR][/B][COLOR=#333333],"")[/COLOR]
Note that with this last step, the appearance of the percentages may change to decimals. But that can easily be changed with a custom format on the cell/column.
 
Upvote 0
Cross posted https://www.excelforum.com/excel-ge...-formatting-on-cells-containing-formulas.html

Cross-Posting
While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0

Forum statistics

Threads
1,216,191
Messages
6,129,424
Members
449,509
Latest member
ajbooisen

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