Conditional Format Question

boonetrailboy

New Member
Joined
Mar 14, 2007
Messages
4
Hi,

I have a data table similar to the following:

9.1% 45.0%
4.0% 100.0%
99.0% 96.0%
75.0% 98.0%
55.0% 100.0%

I would like to mask the cells that are below 5% and above 95% to show <5% and >95% respectively.

These are large tables and not practical to manually edit. Any suggestions?

Thanks in advance,
John
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
So if a cell is, for example, 4.0%, you want to change the value of the cell to <5%?
 
Upvote 0
You can't replace with formulas in that way. Formulas can only change the value of the cell that contains the formula. I believe you'll need to use VBA. Are you open to a VBA solution?
 
Upvote 0
Try this:

Code:
Sub FiveAndNinetyFive()

    Dim r As Range
    Dim s As Range
    
    Application.ScreenUpdating = False
    
    Set r = Range(Cells(1, 1), Cells(ActiveSheet.UsedRange.Rows.Count, _
        ActiveSheet.UsedRange.Columns.Count))
    
    For Each s In r
        If s < 0.05 Then
            s.Value = "<5%"
        ElseIf s > 0.95 Then
            s.Value = ">95%"
        End If
    Next s
    
    Application.ScreenUpdating = True
    
End Sub

If you have thousands of lines, it may take a bit. I would test it on a smaller sample.
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,334
Members
449,077
Latest member
Jocksteriom

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