+ Reply to Thread
Results 1 to 13 of 13

countif using range in conditional formatting

  1. #1
    Registered User
    Join Date
    01-20-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2010
    Posts
    69

    countif using range in conditional formatting

    Several inventory spreadsheets in a workbook, a new one added each week w/ current inventory. Column A=item numbers with a range name. I then use conditional formatting to highlight all cells containing new items. ie.. new arrivals and did not exist in previous week's sheet.

    I do get some cells to highlight correctly and I thought it was working but then I find SOME of those item numbers do exist in the previous weeks sheet. So..... what have I done wrong?

    Very simple but oh so elusive!
    So many questions and so many helpful people here that I can't seem to find this.
    Thank-you in advance.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: countif using range in conditional formatting

    lisach,

    Maybe you could throw us a bone and identify some of the problem cells?
    Brendan.


    __________________________________________________________________________________________________
    Things to consider:

    1) You can thank any poster by clicking the * at the left of a helpful post.
    2) You can help to keep the forum tidy by marking your thread as "Solved", if it has been answered to your satisfaction.
    3) Help us to help you, by uploading a sample workbook, showing the type of data you're dealing with, and clearly indicating what the results should be.

  3. #3
    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
    53,051

    Re: countif using range in conditional formatting

    change the CF formula from =COUNTIF(newlist0530,A2)=0 to =COUNTIF(newlist0530,A3)=0

    Also, I would question the need to use a new sheet for each week? You could probably just as easily use 1 sheet and use countifS() for a date range in the CF
    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

  4. #4
    Registered User
    Join Date
    01-20-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: countif using range in conditional formatting

    OMG! So sorry. Yes.
    sheet 6-27-13
    line 31 highlighted in green is not present on sheet 5-30-13
    line 32. highlighted in green is present on sheet 5-30-13
    line 128 highlighted in green is present on sheet 5-30-13

    and it goes on. when i filter those cells in green, I see some that are new and some that are not new

  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
    53,051

    Re: countif using range in conditional formatting

    did you read my post?

  6. #6
    Registered User
    Join Date
    01-20-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: countif using range in conditional formatting

    FDibbins....
    I made the suggested change and that seems to have done the trick. could you please explain how that made a difference? I am not understanding the significance of the change.

    to answer your question. I receive the new sheets in email from a supplier and my associate likes to see the new sheet as a stand alone. I just hate trying to figure out what items are new.

  7. #7
    Registered User
    Join Date
    01-20-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: countif using range in conditional formatting

    FDibbins...
    The change you suggested seems to work on the 6-27-13 sheet (didn't check each and every one) But, going on the assumption that this would apply to each of the sheets I went back to the 5-30-13 sheet. I filtered the cells based on the green color. I changed the CF with the adjustment to A3 and the results were impacted. The result included items that are present on the preceding 05-20 sheet.
    Line 161 item M170-144 should not have been highlighted green as it does appear on the 05-20 sheet.
    Line 268 item M150-855 should not have been highlighted green as it does appear on the 05-20 sheet

    thoughts suggestions????

  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
    53,051

    Re: countif using range in conditional formatting

    The mistake you made in the 1st sheet you mentioned was because you started the CF in row 3, but referenced row 2, so the CF was always looking at the row above to test its criteria.

    I will take a look at the other sheets
    Last edited by FDibbins; 07-15-2013 at 11:25 PM. Reason: fixed typo

  9. #9
    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
    53,051

    Re: countif using range in conditional formatting

    OKJ looking at the 1st 3 date sheets, the data all starts in row 2, so the CF formula on those sheets was correct. It's only on the last sheet that you have an extra line above the data and below the headingf (row 2)

  10. #10
    Registered User
    Join Date
    01-20-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: countif using range in conditional formatting

    I see why you said that. I attached another book showing a compare and cells that were formatted green that shouldn't be and cells tat weren't formatted that should have been. Please take a look at this workbook and let me know. Maybe the countif is not the right way to do it. I'm pretty confused at this point.
    Attached Files Attached Files

  11. #11
    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
    53,051

    Re: countif using range in conditional formatting

    the range you are using in the CF is for 520, but you are comparing 530 to 627

  12. #12
    Registered User
    Join Date
    01-20-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: countif using range in conditional formatting

    I created the range newlist0627. I select the range. I choose CF new rule. use formula to determine which cells to format. The formula I use is... =COUNTIF(newlist0530,A3)=0

    on sheet 05-30 I created the range newlist0530. Select the range. choose CF and use formula...... =COUNTIF(newlist0520,A2)=0

    On each new sheet the "newlist" range of item numbers should format in green those cells containing item numbers that do not exit in the previous sheet. Thereby showing me those new items.

    Or at least that is how I intended for it to work out. Not sure what you meant by ..."the range you are using in the CF is for 520"

  13. #13
    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
    53,051

    Re: countif using range in conditional formatting

    I have taken a slightly different approach and combined all data onto 1 sheet. I started the CF in row 453 and used...
    =COUNTIF($B$2:B453,B453)=1

    All you now need to do when you have more data, is increase the APPLIES to range, and add dates in (new) column A

    take a look, check it and let me know if this is something you can work with?
    Attached Files Attached Files

+ 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 countif - dynamic range
    By Stroem in forum Excel General
    Replies: 3
    Last Post: 10-12-2012, 04:36 AM
  2. [SOLVED] Countif and conditional formatting
    By SLKPM in forum Excel General
    Replies: 0
    Last Post: 09-30-2005, 06:05 AM
  3. Conditional Formatting And Countif
    By cafe in forum Excel General
    Replies: 6
    Last Post: 08-10-2005, 03:40 PM
  4. [SOLVED] Countif with conditional formatting
    By Johnny in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-06-2005, 08:06 AM
  5. Countif and Conditional Formatting
    By Ramiro Espinoza in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-02-2005, 02:06 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