+ Reply to Thread
Results 1 to 27 of 27

Conditional formating with 3 different rules applied

  1. #1
    Forum Contributor
    Join Date
    05-22-2015
    Location
    Malaysia
    MS-Off Ver
    MS365
    Posts
    197

    Conditional formating with 3 different rules applied

    Hi,

    I am trying to apply the below rules on number of failed backup. I can do the formula for Priority 3 but Priority 1 and Priority 2 overwrites Priority 3.

    Rules:
    Priority 1 if any cell value >= 3 continuous days (highlight Red)
    Priority 2 If any value is one after another >= 3 times (ex 1, blank, 1, blank 1) (highlight Yellow)
    Priority 3 If value >= 2 in the cell for 1 day only (highlight Blue)

    Is it possible to use index and match or other formula linked to "DataFailBakup" or use macros? I am not very familiar in using macros.

    Attached is the sample file for your reference.

    Would really appreciate if can assist on this. Thank you.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    05-22-2015
    Location
    Malaysia
    MS-Off Ver
    MS365
    Posts
    197

    Re: Conditional formating with 3 different rules applied

    Hi,
    Can anyone assist? if this issues can be solved using macros, I don't mind trying out.

    The team would like to have conditional formating as it's taking longer time to discuss and identifying using the pivot table way.

    Would appreciate your great help on this.

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Conditional formating with 3 different rules applied

    Pl see file With Macro "MacroForColor"
    Dashboard(2) is After running Macro

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    05-22-2015
    Location
    Malaysia
    MS-Off Ver
    MS365
    Posts
    197

    Re: Conditional formating with 3 different rules applied

    Hi,

    Thank you for the macros. It is working but found some errors as attached.

    1) It did not initialize when I select the next month for yellow and blue conditions
    2) there should be continous detection when I select the next month

    Please refer to attachment for viewing. Thank you.

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Conditional formating with 3 different rules applied

    Macro will not run automatically. You have to run manually whenever change done. otherwise worksheet events is to be used.

  6. #6
    Forum Contributor
    Join Date
    05-22-2015
    Location
    Malaysia
    MS-Off Ver
    MS365
    Posts
    197

    Re: Conditional formating with 3 different rules applied

    When I change the Month either to November or December at AK4 and ran the macro manually, it did not initialize the blank fields.

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,452

    Re: Conditional formating with 3 different rules applied

    See attachment for first criteria.
    Attached Files Attached Files
    Quang PT

  8. #8
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Conditional formating with 3 different rules applied

    I have corrected code. Pl check now.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    05-22-2015
    Location
    Malaysia
    MS-Off Ver
    MS365
    Posts
    197

    Re: Conditional formating with 3 different rules applied

    Hi bebo021999

    The first criteria is working well and when I change another month it works well too.

    Would love to know how to apply further for Criteria 2 and 3 in conditional formating.
    Last edited by suchetherrah; 11-17-2015 at 02:34 PM.

  10. #10
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Conditional formating with 3 different rules applied

    Wrong posting deleted.

  11. #11
    Forum Contributor
    Join Date
    05-22-2015
    Location
    Malaysia
    MS-Off Ver
    MS365
    Posts
    197

    Re: Conditional formating with 3 different rules applied

    Hi,

    The management prefers to update automatically than key in the range manually after running macros.
    Purpose to have quick discussion on backup failures during the meeting.

    As per user's request, would like to have your advise using formulas than macros for Criteria 2 and 3 in conditional formulating.

  12. #12
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Conditional formating with 3 different rules applied

    Is the range for colouring L12:AP54 is fixed or it varies.

  13. #13
    Forum Contributor
    Join Date
    05-22-2015
    Location
    Malaysia
    MS-Off Ver
    MS365
    Posts
    197

    Re: Conditional formating with 3 different rules applied

    Yes, The file keeps increasing everyday in the Data worksheet and a formula has been set to identify new policies in the dashboard of Column K.

  14. #14
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Conditional formating with 3 different rules applied

    Pl see file
    Worksheet event is used for Dashboard. When month is changed worksheet_change event runs macro automatically.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  15. #15
    Forum Contributor
    Join Date
    05-22-2015
    Location
    Malaysia
    MS-Off Ver
    MS365
    Posts
    197

    Re: Conditional formating with 3 different rules applied

    Hi,

    Thanks a lot for your effort. It worked beautifully. It has saved a lot of my time identify.
    I am trying to understand the macros but I need a lot of time to understand it.

  16. #16
    Forum Contributor
    Join Date
    05-22-2015
    Location
    Malaysia
    MS-Off Ver
    MS365
    Posts
    197

    Re: Conditional formating with 3 different rules applied

    Hi,

    I have an issue where the macro is not highlighting for Red and yellow color when the same policy overflows to next month. For example

    31/10/15, 1/11/15 and 2/11/15 should hightlight as red but it's not highlighting
    29/10/15, 31/10/15 and 2/11/15 should highlight as yellow but it's not highlighting

    Should I continue the same thread eventhough this thread is solved coz I am still having issues. Or should I create a new thread.
    Please advise.

  17. #17
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Conditional formating with 3 different rules applied

    Include all dates in next columns. as per your file AP is the last column. In the macro same is included. After including the dates as said Find the last column and replace AP by that column, then run the macro.Change is to be done in
    Set IPrng = Range("L12:AP" & LR)

  18. #18
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional formating with 3 different rules applied

    I'm late to this party but here is a strictly conditional formatting solution (I think). Conditions must be entered in reverse order of priority so that red is the first conditional format seen when "managing rules" (image below).

    Select L12:AP54

    Okay, for some reason, the forum is not letting me print my formulas. I will include them as images
    Attached Images Attached Images
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  19. #19
    Forum Contributor
    Join Date
    05-22-2015
    Location
    Malaysia
    MS-Off Ver
    MS365
    Posts
    197

    Re: Conditional formating with 3 different rules applied

    Thank you both for responding this thread. I have tested both Macros and conditional formating method. Attached are the results.

    As for Macros,
    I have applied the same marco as mentioned but it's not working. The challenge is towards the end of October. When I select November the position of that policy name changes which needs to highlight the conditions. For example:

    Policy A : 31/10/15, 1/11/15 and 2/11/15 should hightlight as red but it's not highlighting
    Policy B : 29/10/15, 31/10/15 and 2/11/15 should highlight as yellow but it's not highlighting
    Please see attachment for macros.


    As for Conditional Formatting,
    I have applied the rules in the conditional format but not working when I select another month.
    1) It's not initialized when select another month.
    2) when comes to next month, it need to check the policy with the previous end of the month and hightlight either red or yellow accordingly.

    Please see attachment for conditional formating.
    Last edited by suchetherrah; 12-08-2015 at 06:49 AM.

  20. #20
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Conditional formating with 3 different rules applied

    The cell where month was in AK4 now changed to E7. Accordingly worksheet_event is changed. Now it is working.

  21. #21
    Forum Contributor
    Join Date
    05-22-2015
    Location
    Malaysia
    MS-Off Ver
    MS365
    Posts
    197

    Re: Conditional formating with 3 different rules applied

    I did a test. It's not working.

    I have changed the name of the policy to have a clear view and highlighted in amber for No 23 and No 34 in the month of october.
    Then, change to month of November. It is a continuation of last month.

    Policy A - Number 23/PDC - 31/10/15, 1/11/15 and 2/11/15 should hightlight as red
    Policy B - Number 34/PDC - 29/10/15, 31/10/15 and 2/11/15 should highlight as yellow

    Please view attachment for better understanding.
    Last edited by suchetherrah; 12-08-2015 at 06:50 AM.

  22. #22
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional formating with 3 different rules applied

    I see the blue rule went all haywire on us. That's easy to fix. The issue I didn't address is the inter-month patterns (previous and post). One way we could address that is to insert 3 days before and post and hide them. I will post a new worksheet soon.

  23. #23
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional formating with 3 different rules applied

    Okay, here's the one with the hidden columns.
    Had to do 4 days before and 4 days after to catch the alternating yellow pattern.
    Attached Files Attached Files

  24. #24
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Conditional formating with 3 different rules applied

    where are the columns for 1/11, 2/11,3/11 in worksheet. Macro can colour only columns are available in sheet.
    It is better if 3 columns in the beginning and end are added for previous month and next month
    Last edited by kvsrinivasamurthy; 12-02-2015 at 11:02 AM.

  25. #25
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional formating with 3 different rules applied

    Hi Kvrinivasamurthy,

    Is post #24 question related to my post #23? If so, the there are 4 days pre and post included in the calculations (rows 9 to 78) but they are hidden and no conditional formatting is linked to them. If the OP sees a single (or 2) red 1's at the beginning or end of the month, they will automatically know that if they pull up the next/previous month, they will see that pattern continued. Hope that helps clarify.
    Last edited by ChemistB; 12-02-2015 at 01:44 PM.

  26. #26
    Forum Contributor
    Join Date
    05-22-2015
    Location
    Malaysia
    MS-Off Ver
    MS365
    Posts
    197

    Re: Conditional formating with 3 different rules applied

    You are absolutely brilliant. It worked beautifully. It didn't came accross this method in my mind.
    I have learnt a lot from both of you and I loved it. My bosses loved this dashboard.

    Thank you for the effort and really appreciate it.

  27. #27
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Conditional formating with 3 different rules applied

    Welcome suchetherrah.

    Hi ChemistB,
    I did not refer to your file. I referred to File 3-different-rules-applied-failbackupmacro ans.xlsm only.
    Regards
    KVS‎

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Conditional Formating - 2 rules and results in one cell
    By jono7gold in forum Excel General
    Replies: 4
    Last Post: 07-16-2014, 07:58 AM
  2. combine 2 conditional formating rules
    By abaines in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-13-2014, 09:58 AM
  3. Replies: 4
    Last Post: 11-27-2013, 03:13 PM
  4. Conditional formatting: Applied rules not visible when printing
    By efernandes67 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2013, 03:32 PM
  5. [SOLVED] Conditional Formating not applied on all Worksheet_Change events
    By Oliver Vistisen in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-25-2013, 05:50 AM
  6. [SOLVED] Conditional Formating Rules/IF---help with attached
    By awest181 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-26-2012, 06:16 PM
  7. Setting Rules for Conditional Formating
    By vkazmierski in forum Excel General
    Replies: 7
    Last Post: 03-15-2012, 06:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1