+ Reply to Thread
Results 1 to 11 of 11

Conditional Formatting

  1. #1
    Registered User
    Join Date
    11-07-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    72

    Conditional Formatting

    Background: I have a worksheet with different unit types. Each unit type has specific dimensions (width(W) x height(H)). Some of the units are entered in as WxH and others HxW. I'm trying to highlight units that have the same square footage but do not have the same dimensions. For example, if if there is a 200'x50' and a 50'x200', they will both have a squarefootage of 10,000. There is no need to highlight this info because I can count them as the same unit type, but I cannot change the sizes to match each other because they are different and I don't want to lose track of that. My problem arises when I have a 100'x100' unit that results in the same, 10,000 sqft. I need to highlight this unit because it is unique and needs to be manually adjusted for further processing. How can I highlight the 100'x100' unit without highlighting the 200'x50' & 50'x200' units?

    The best I could figure out is that I probably need to be using the countifs function, but beyond that, I'm clueless. See example attached for additional details. Any help on this would be greatly appreciated. Thanks in advance.

    Book2.xlsx

  2. #2
    Registered User
    Join Date
    11-07-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    72

    Re: Conditional Formatting

    It's amazing. I've been working on this for hours. I post on here and then immediately after, I have my "ah ha" moment and figure out the solution...

    I added some helper cells that take the MIN & MAX value of the dimensions. Thus, if it's a 50x100 and a 100x50, it will put both of those in as 50x100's in the helper cells. Then I used countif>1 for counting the square footages and countif =1 for the concatenates. Then placed a formula that spits out "1" if both of those entry's come back as true and applied condition formatting to that number. See attached for solution.

    Book3.xlsx
    Last edited by ipausa; 09-02-2013 at 03:06 PM.

  3. #3
    Registered User
    Join Date
    11-07-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    72

    Re: Conditional Formatting

    One major problem I just discovered in my "solution" is that if I have multiple 50x200's, it will not produce a 1 in H21... and doesn't highlight the issue that needs manual fixing.

  4. #4
    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,939

    Re: Conditional Formatting

    Hi

    I added 2 helpers F and G and used these copied down...
    F2=MAX(B2:C2)
    G2=MIN(B2:C2)
    and then based my CF on this...
    =COUNTIFS($F$2:$F$9,F2,$G$2:$G$9,G2)<2

    This will highlight the 1's you currently have as unhighlighted - if thats the way you want itm change it from <2 to >1
    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

  5. #5
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Conditional Formatting

    Do away with the helper columns..Use this in CF rule

    =SUMPRODUCT(($A$2:$A$9=$A2)*($B$2:$B$9=$C2)*($C$2:$C$9=$B2))+SUMPRODUCT(($A$2:$A$9=$A2)*($B$2:$B$9=$B2)*($C$2:$C$9=$C2))-(B2=C2)>1

    format
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  6. #6
    Registered User
    Join Date
    11-07-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    72

    Re: Conditional Formatting

    Quote Originally Posted by FDibbins View Post
    Hi

    I added 2 helpers F and G and used these copied down...
    F2=MAX(B2:C2)
    G2=MIN(B2:C2)
    and then based my CF on this...
    =COUNTIFS($F$2:$F$9,F2,$G$2:$G$9,G2)<2

    This will highlight the 1's you currently have as unhighlighted - if thats the way you want itm change it from <2 to >1
    I don't think I'm understanding your solution as I am unable to get it to produce the result I'm trying to achieve. I don't know whether I explained the original issue incorrectly or whether I'm just simply not understanding your solution. When I enter in what you have above, I receive "TRUE"s in row's 6 & 7. I'm trying to seperate row 9 from the rest since it's unique but displaying as not unique due to it sharing the same squarefootage as rows 4 & 5.

  7. #7
    Registered User
    Join Date
    11-07-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    72

    Re: Conditional Formatting

    Quote Originally Posted by Ace_XL View Post
    Do away with the helper columns..Use this in CF rule

    =SUMPRODUCT(($A$2:$A$9=$A2)*($B$2:$B$9=$C2)*($C$2:$C$9=$B2))+SUMPRODUCT(($A$2:$A$9=$A2)*($B$2:$B$9=$B2)*($C$2:$C$9=$C2))-(B2=C2)>1

    format
    When using that for the formula in CF, I receive rows 2,3,4,5,8,9 as highlighted which does not produce the result I'm trying to achieve.

  8. #8
    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,939

    Re: Conditional Formatting

    See the attached...
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    11-07-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    72

    Re: Conditional Formatting

    Quote Originally Posted by FDibbins View Post
    See the attached...
    This still isn't what I'm trying to achieve. In the same excel sheet you attached, I'm trying to highlight the row with Type 2 50x200 (row 9) because, even though it has the same square footage as Type 2 100x100, it is not the same. I must have explained what I was trying to achieve incorrectly and for that I apologize.

  10. #10
    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,939

    Re: Conditional Formatting

    I have re-applied my sugvgestion to your file, but have created a 3rd table, below your 2nd table, and apart from the 10000 in D21, all shading is identical. Is d21 the cell you are talking about?
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    11-07-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    72

    Re: Conditional Formatting

    This works! Thank you guys for the help.

+ 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 via VBA: Change formatting in range based on value of each cell
    By ralphjmedia in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2013, 10:37 AM
  2. Delete Conditional Formatting conditions but keep cell formatting - Excel 2010
    By tetreama in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-09-2012, 08:28 PM
  3. Replies: 3
    Last Post: 05-15-2012, 04:13 PM
  4. Macro for formatting fonts and cell colours - not Conditional Formatting
    By Kayaness in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-07-2011, 03:46 AM
  5. Replies: 2
    Last Post: 11-02-2007, 12:03 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