Consulting

Results 1 to 3 of 3

Thread: Conditional Formatting with Multiple Criteria

  1. #1

    Conditional Formatting with Multiple Criteria

    Dear Sir,
    I wanted to highlight duplication entries based on multiple conditions.
    Example: if Column C that is entry date, Column E Vehicle number, Column G Type of expenses if same then Column B entry number should be highlighted as duplicate entry.
    Example: if Column C that is entry date, Column E Vehicle number is same but columns G Type of expenses are not same then Column B entry number should not be highlighted as duplicate entry.
    Attached Files Attached Files

  2. #2
    VBAX Mentor
    Joined
    Aug 2012
    Posts
    367
    Location
    Hi,

    you can use the conditional formatting to highlight duplicate values.
    If the duplication requires testing of values in more than one column, you can create a test string by concatenating cell values.

    to try this, put "C" in cell a1, "1" in cell b1, and "=a1 & b1" in cell c1.

    you can use this to create the test value from which you can use the find duplicates/conditional formatting features
    Remember: it is the second mouse that gets the cheese.....

  3. #3
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,874
    In the attached, conditional formatting has been applied to cell B2:B5. The formula used therein has also been put in column K. This is only FYI and doesn't need to be there.
    The columns referred to in the formula may not be the correct ones since what you assk for in msg#1 here and in the Excel file are different. You can easily adjust the CF formula to suit.
    (The formula is along the lines of: =SUMPRODUCT(--($B$2:$B$5=B2),--($C$2:$C$5=C2),--($G$2:$G$5=G2))>1 which can be shortened: =SUMPRODUCT(($B$2:$B$5=B2)*($C$2:$C$5=C2)*($G$2:$G$5=G2))>1)
    Attached Files Attached Files
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Posting Permissions

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