+ Reply to Thread
Results 1 to 16 of 16

conditional formatting for multiple criteria

  1. #1
    Registered User
    Join Date
    09-12-2013
    Location
    adelaide
    MS-Off Ver
    Excel 2010
    Posts
    7

    conditional formatting for multiple criteria

    Hi, new member, so hi all, and thanks for all the advice i've had from looking at historic posts!

    My problem:

    I have a list of names in col A that may have new entries each month causing multiple occurrences of the same name. In column L, I indicate if there has been any contact with the customer by: letter, "L", visit "V" or no contact (blank).

    I have got cond formating to show when a person has had a letter or visit in both col A nd L.

    My dilema is this. When a person has had a letter, i want all the times their name appears in col A to change when an L or V is enterd against one of their names. There will still be blanks from previous months where no contact was made, which must remain blank.

    I'm stuck. So far, all i can get is when there is an L, and there is more than one occurrence of the name, i can get the colour in Col A to change for the name where the L is in the same row, but not for the other times their name appears:

    =(COUNTIF(A:A,$A2)>1)*($L2="L")

    Any help please?

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: conditional formatting for multiple criteria

    Untested, but try:

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    09-12-2013
    Location
    adelaide
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: conditional formatting for multiple criteria

    DAMN IT!!! I think my last post failed, so appologies if this is a duplicate

    Thanks trevor, That goes some of the way towards what i was looking for, but i am still only getting col A to format the name when there is an L or V in the same row.
    It will not format that name elsewhere in the rest of col A if there is no entry on the row.
    I am not explaining this very wel!!

    Is there a way to write something that will do this : "If A2 is formatted because of col L, format for other occurrences of contents of A2 regardless of col L in other rows"

    I can post a screen dump if that is possible?
    Last edited by tom72517; 09-13-2013 at 05:09 AM. Reason: clarity

  4. #4
    Registered User
    Join Date
    09-12-2013
    Location
    adelaide
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: conditional formatting for multiple criteria

    Spread sheet help.jpg

    This shows what I'm looking for.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: conditional formatting for multiple criteria

    Please do not upload a picture of your file...rather, upload a sample of your workbook, showing what data you are working with, a few samples of your expected outcome is (manually entered is ok) and how you arrived at that. (exclude sensitive info). Pictures are pretty much impossible to edit, and no-one wants to re-type your data for you Also, not all members can upload picture files (Company firewalls and stuff)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: conditional formatting for multiple criteria

    Can't do this now because I have limited access to the Internet and no excel. But my suggestion would be to create a Helper table. Column 1 list all the unique codes (column A) using a formula or Advanced Filter. Column 2 use COUNTIFS for column 1 where column L is "L". Column 3 use COUNTIFS for column 1 where column L is "V". Column 4 add columns 2 and 3.

    Then, in your CF use a VLOOKUP to return column 4 for column A. Greater than 1, highlight the row.

    Regards, TMS

  7. #7
    Registered User
    Join Date
    09-12-2013
    Location
    adelaide
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: conditional formatting for multiple criteria

    Thanks for the help

    I tried what you said TMS, and set up a second sheet to count as you described, but still can't get the formula to change for all the names on the main sheet!

    Sorry about the Jpeg FDibbins, file posted in next comment
    Last edited by tom72517; 09-17-2013 at 12:02 AM. Reason: update

  8. #8
    Registered User
    Join Date
    09-12-2013
    Location
    adelaide
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: conditional formatting for multiple criteria

    I think this upload has worked.....
    Attached Files Attached Files
    Last edited by tom72517; 09-17-2013 at 09:30 PM.

  9. #9
    Registered User
    Join Date
    09-12-2013
    Location
    adelaide
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: conditional formatting for multiple criteria

    Hi, just hada few weeks off work and have come back to try to get this to work!

    Any suggestions on how to get the results i need as shown in the previous post's example? tearing my hair out trying to fix this so any help is appreciated

  10. #10
    Registered User
    Join Date
    10-02-2013
    Location
    Brisbane
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: conditional formatting for multiple criteria

    Hi Tom,

    Try this equation in the conditional formatting; applying to =$A$2:$A$19

    =INDEX($A$2:$A$19,MATCH(1,IF($A$2:$A$19=A2,1,0)*IF($L$2:$L$19="L",1,0),0))=A2

    Seems to be working on your sample spreadsheet not sure how it will differentiate between L's and V's though as names that have had both will both want formatting, (not sure that made sense). Maybe have L's apply fill while V's change the text colour.

    Let me know how you go.

    Cheers,

  11. #11
    Registered User
    Join Date
    10-02-2013
    Location
    Brisbane
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: conditional formatting for multiple criteria

    The formatting issue I noted earlier regarding differentiating between L's and V's can be fixed easily. Just rearrange the order of conditional formatting equations in the manage rules option; the one on the top will have priority when both apply.

    You will need two conditional formatting equations for =$A$2:$A$19. One for L's and one for V's, see below:

    =INDEX($A:$A,MATCH(1,IF($A:$A=A2,1,0)*IF($L:$L="V",1,0),0))=A2
    =INDEX($A:$A,MATCH(1,IF($A:$A=A2,1,0)*IF($L:$L="L",1,0),0))=A2

    Works fine in your sample spreadsheet although changing it to A:A and L:L made my computer run really slow due to the extra calculations; could just be my computer though.

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: conditional formatting for multiple criteria

    Any time you use entire columns in an array formula, it has the potential to slow things down. It is better if you can restrict the range to just what's needed

  13. #13
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: conditional formatting for multiple criteria

    try:
    =COUNTIFS(A:A,A2,L:L,"L")

    then:
    =COUNTIFS(A:A,A2,L:L,"V")

    must be in that order or you could also do ensure the blue is on top of the red when inside the Conditional Formatting Rules Manager (ALT + O + D)

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  14. #14
    Registered User
    Join Date
    09-12-2013
    Location
    adelaide
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: conditional formatting for multiple criteria

    Thanks to you all.

    Guest_35, yours works exactly as i wanted, and once i'd set the range correctly, it didn't kill the computer so thanks FDibbins for that save too.

    benishiryo, thanks for the efforts too, much appreciated.

  15. #15
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: conditional formatting for multiple criteria

    See the attached updated example ... just to show the approach I outlined.

    Obviously it's simpler if you don't need the lookup table

    Regards, TMS
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    10-02-2013
    Location
    Brisbane
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: conditional formatting for multiple criteria

    Quote Originally Posted by tom72517 View Post
    Thanks to you all.

    Guest_35, yours works exactly as i wanted, and once i'd set the range correctly, it didn't kill the computer so thanks FDibbins for that save too.

    benishiryo, thanks for the efforts too, much appreciated.
    No worries... Sometimes referencing a limited array can be an issue for those who didn't create the spreadsheet, as they don't know what the equations are doing i.e. when they insert lines or information outside of the array without realising it. If you're the only person using/updating the spreadsheet it would be fine to limit the array.

+ 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. Conditional formatting with multiple criteria
    By floribunda in forum Excel General
    Replies: 3
    Last Post: 05-16-2013, 07:12 AM
  2. Replies: 5
    Last Post: 12-28-2012, 02:06 PM
  3. Conditional formatting with multiple criteria
    By boxty123 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-28-2012, 09:59 PM
  4. Conditional formatting on multiple criteria
    By floribunda in forum Excel General
    Replies: 2
    Last Post: 07-11-2011, 10:25 AM
  5. Conditional Formatting with multiple criteria
    By Lara in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-26-2006, 06:00 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