r/excel • • 6h ago

unsolved Conditional formatting: highlighting both positive and negative percentages above a certain threshold

I work in workforce management, I inherited an excel from someone who left the company and I dont understand one of the conditional formats he set.

He has formulas

=AND(ABS(T4)>0.35,ABS(E4)<=0.4) make the cell dark orange

=AND(ABS(T4)>0.2,ABS(E4)<=0.3) make the cell light orange

This is applied to cells T4:T9 but cell T4 specifically never seems changed

What i want is if the number is 25-59% (positive and negative, meaning above forcast or below forecast) its light orange and if its 60% or more (positive and negative, meaning above forecast or below) its dark orange

I attempted making if >.25 light orange and then if <-.25 light orange but no success

2 Upvotes

25 comments sorted by

•

u/AutoModerator 6h ago

/u/GayADHDLurker - Your post was submitted successfully.

Failing to follow these steps may result in your post being removed without warning.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/seandowling73 4 6h ago

I would just create a copy of the sheet and try removing all conditional formatting rules and the re-create them

2

u/GayADHDLurker 5h ago

Yeah im in the process of doing that but still looking for a way to get the conditional formatting right for that column

2

u/Dangerous_Cup3607 1 5h ago

You might want to create conditional formatting with a hierarchy as you manage the conditional rules.

  1. Rule 1 less than -30% (stop if true)
  2. Rule 2 less than -20% (stop if true)
  3. Rule 3 less than 0% (stop if true)
  4. Rule 4 greater than 30% (stop if true)
  5. Rule 5 greater than 20% (stop if true)
  6. Rule 6 greater than 0% (stop it true).

1

u/PaulieThePolarBear 1927 6h ago

What do you mean by "the number"? The formulas you presented are referencing two different cells

1

u/GayADHDLurker 5h ago

The cells have formatting that gives a percentage by looking at the number of calls forecasted (a different cell) vs the number of calls handled and calculating the petcent under/over forecast. This formula i have no problem with and understand, its the conditional formating im having the issue and the cell value is always a percentage from the other formula

1

u/PaulieThePolarBear 1927 5h ago

But is "the number" T4 or E4?

1

u/GayADHDLurker 4h ago

Oh I wasnt referring to either im not sure why t4 and e4 are even there tbh thats the last guys equation

1

u/PaulieThePolarBear 1927 4h ago

Then I'm not clear what you are asking for.

Please provide clear and concise details of what you are trying to do. Ignore anything someone else has done - state only what your end goal is. Recall that our only insight in to your issue is the details you provide to us, and as such, you should clearly set out your requirements

1

u/GayADHDLurker 4h ago

What i want is if the number is 25-59% (positive and negative, meaning above forcast or below forecast) its light orange and if its 60% or more (positive and negative, meaning above forecast or below) its dark orange

I attempted making if >.25 light orange and then if <-.25 light orange but no success

1

u/PaulieThePolarBear 1927 3h ago

You still haven't defined "this number". You've told me what it isn't, but I'm still guessing as to what you mean by this. Please clearly state what you mean by this.

1

u/GayADHDLurker 3h ago

The cell, no specific cell number given

1

u/PaulieThePolarBear 1927 3h ago

Just to be clear.

You want conditional formatting that will apply to all cells in your range, say A2:Z99, if the value in that cell is within the bounds you have stated?

1

u/GayADHDLurker 3h ago

I dont have the spreadsheet in front of me but I believe its cells E4:E9

→ More replies

1

u/diegojones4 6 5h ago

Conditional formatting sucks in my opinion. Just use VBA.

Sub HighlightSend() 'Pre email

Dim ws As Worksheet

Dim CellVal1 As Double

Dim CellVal2 As Double

Dim CellLen As Integer



    With Application

        .ScreenUpdating = False

        .StatusBar = "Life's a garden, dig it"

        .DisplayAlerts = True

    End With

On Error Resume Next

    Set ws = ActiveWorkbook.Worksheets("Summary")

    ws.Activate

    Range("G8").Activate

       

    Do While ActiveCell.Value <> "END"

        CellVal1 = ActiveCell.Value

        CellVal2 = ActiveCell.Offset(0, 1).Value

        CellLen = Len(ActiveCell.Offset(0, -4))

       

        If CellLen <> 0 Then

            ActiveCell.Font.Bold = False

            ActiveCell.Offset(0, 1).Font.Bold = False

        End If

       

        With Selection.Interior

            .Pattern = xlNone

            .TintAndShade = 0

            .PatternTintAndShade = 0

        End With

       

        With ActiveCell.Offset(0, 1).Interior

            .Pattern = xlNone

            .TintAndShade = 0

            .PatternTintAndShade = 0

        End With

       

        If CellLen > 0 Then

            If Abs(CellVal1) >= 1000000 And Abs(CellVal2) >= 0.1 Then '100,000 and 10%

                Selection.Interior.Color = RGB(255, 253, 177)

                Selection.Font.Bold = True

                ActiveCell.Offset(0, 1).Interior.Color = RGB(255, 253, 177)

                ActiveCell.Offset(0, 1).Font.Bold = True

            End If

       

            If Abs(CellVal1) >= 10000000 Then '10,000,000

                Selection.Interior.Color = RGB(255, 253, 177)

                Selection.Font.Bold = True

                ActiveCell.Offset(0, 1).Interior.Color = RGB(255, 253, 177)

                ActiveCell.Offset(0, 1).Font.Bold = True

            End If

        End If

               

        ActiveCell.Offset(1, 0).Activate

   

    Loop

2

u/GayADHDLurker 4h ago

Vba is a bit too advanced for me lol I have no idea what that even is.

1

u/diegojones4 6 3h ago

10 years ago I really didn't either. But to stay relevant I take a lot of classes. I'm still not a coder but there are times when it's just necessary. Like adding a new formula into your knowledge base. Learn something new everyday or you will be outdated. I've been working in workbooks professionally before Excel really came into prominence.

1

u/AutoModerator 5h ago

I have detected VBA code in plain text. Please edit to put your code into a code block to make sure everything displays correctly.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/diegojones4 6 5h ago

I could clean it up but it is a legacy file and I was just working around conditional formatting creating a new rule everytime something changes.

2

u/ConsoliSheet 6h ago

T4 not changing is usually one of the two things: the "Applies to" range is relative (T4:T9 instead of $T$4: $T$9), or T4 has a manual fill color on it, which overrides conditional formatting.

For your thresholds, delete the old rules and add two new ones:

. Light orange (25% to 59%, both direction): =AND(ABS(T4)>=0.25,ABS(T4)<0.6)
. Dark orange (60%+): =ABS(T4)>=0.6

Put the dark orange rule above the light orange one, tick Stop if true on it, and set "Applies to" to =$T$$: $T$(. The ABS handle positive and negative the same way, so +30% and -30% both go light orange, and +60% and -60% both go dark orange.

1

u/HappierThan 1193 4h ago

In case you may wish to change criteria in the future, why not place your figures in cells which can then be changed temporarily without changing Conditional Formatting formulas. For your 1st condition it may be more practical to use 2 CF Rules both with AND formulas and the 2nd condition with an OR formula.

Light Orange =AND(T4>=$V$1,T4<$W$1) & then =AND(T4<=($V$1*-1),T4>($W$1*-1))

Dark Orange =OR(T4>=$W$1,T4<=($W$1*-1))

1

u/Decronym 4h ago edited 1h ago

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer LettersMore Letters
ABSReturns the absolute value of a number
ANDReturns TRUE if all of its arguments are TRUE
ORReturns TRUE if any argument is TRUE

Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.


Beep-boop, I am a helper bot. Please do not verify me as a solution.
[Thread #49741 for this sub, first seen 25th Nov 2026, 00:24] [FAQ] [Full list] ^[Contact] [Source code]