Conditional Formatting For only values not formulas

YasserKhalil

Well-known Member
Joined
Jun 24, 2010
Messages
852
Hello everybody
I have mixed data in column A (Formulas & Values (Constants) & Blanks )
I want to apply conditional formatting for only Values ( Not Formulas or Blanks)
In other words Values to be highlighted and Colored.
There is a solution by Go to Special and Select Constants .. But I want that by Conditional Formatting
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Conditional Formatting is based on formulas. All you have to do is create a formula that returns TRUE if the entry in a cell is a Value and not a Formula and not Blank.

Check out the CELL function with the TEXT argument like =CELL("TEXT", A1). It can tell you about what is in a cell.
Returns "b" for blank if the cell is empty
Returns "l" for label if the cell contains a text constant
Returns "v" for value if the cell contains anything else.

<tbody>
</tbody>

This might be part of the solution you need:

=CELL("TEXT", A1)<>"b" AND =CELL("TEXT", A1)<>"l"

Best of luck,

G/L
 
Upvote 0
Just in case you have Excel 2013, which I don't, there is a new function called IsFormula which you could use for conditional formatting.
 
Upvote 0
Conditional Formatting is based on formulas. All you have to do is create a formula that returns TRUE if the entry in a cell is a Value and not a Formula and not Blank.

Check out the CELL function with the TEXT argument like =CELL("TEXT", A1). It can tell you about what is in a cell.
Returns "b" for blank if the cell is empty
Returns "l" for label if the cell contains a text constant
Returns "v" for value if the cell contains anything else.

<tbody>
</tbody>

This might be part of the solution you need:

=CELL("TEXT", A1)<>"b" AND =CELL("TEXT", A1)<>"l"

Best of luck,

G/L

I'm using Office 2007 and the formula =CELL("TEXT", A1) returns value error
I tested Type instead of TEXT but the problem is that it returns v for values and formulas !!
I need help
 
Upvote 0
I used this UDF Function
Code:
Function GetFormula(Cell As Range) As String
   GetFormula = Cell.Formula
End Function
Then I used this formula
Code:
=AND(CELL("Type";C1)<>"b";CELL("Type";C1)<>"l";MID(GetFormula(C1);1;1)<>"=")

At last it worked well
 
Upvote 0

Forum statistics

Threads
1,213,497
Messages
6,114,002
Members
448,543
Latest member
MartinLarkin

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