+ Reply to Thread
Results 1 to 10 of 10

Conditional Formatting: Trying to apply CF with if(countif( and it's not working

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

    Conditional Formatting: Trying to apply CF with if(countif( and it's not working

    =IF(COUNTIF(AP2:AP204,1)=0,1,2)

    When I type that formula into any cell in excel, it'll work, but when I insert it into my CF formula, it doesn't work. Any ideas?

    I've also tried:
    =IF(COUNTIF(AP2:AP204,1)="0",1,2)

    But that didn't work either

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Conditional Formatting: Trying to apply CF with if(countif( and it's not working

    CF only returns FALSE or TRUE, to format or not. You cannot return a value with CF. What are you trying to achieve?

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

    Re: Conditional Formatting: Trying to apply CF with if(countif( and it's not working

    I have a large range of data on two different lists. I'm using =IF(ISBLANK(C2),"",IF(C2=Companies!C2,"","1")) to find any discrepancies in my data and then going through 1by1 to update the fileds. Once the fields match, they will replace the "1" with a blank cell and thus, makes my formula work. I wanted to apply CF to my headers so that I knew when a column was done without having to go back and check to make sure there aren't any 1's in that column.

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Conditional Formatting: Trying to apply CF with if(countif( and it's not working

    Could you please post a sample sheet showing BEFORE and AFTER ? Thank you

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

    Re: Conditional Formatting: Trying to apply CF with if(countif( and it's not working

    See attached. As I go through the discrepancies, I update the data in List1 or List2 so that it matches and thus, clears the 1's out of K2:N5.
    Attached Files Attached Files

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

    Re: Conditional Formatting: Trying to apply CF with if(countif( and it's not working

    Attached is the before and after you were asking for. I wasn't quite sure how to do it when you originally asked. But I think this clears it up.
    Attached Files Attached Files

  7. #7
    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,929

    Re: Conditional Formatting: Trying to apply CF with if(countif( and it's not working

    maybe try something like sum(range)=0
    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

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

    Re: Conditional Formatting: Trying to apply CF with if(countif( and it's not working

    Quote Originally Posted by FDibbins View Post
    maybe try something like sum(range)=0
    That was what I originally tried, but it didn't work as it saw the formulas as General. I tried changing the cells to numbers and it still wouldn't sum them. I'd have to copy/paste as values to achieve that but then it won't auto-update my number's once I correct the discrepancies.

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Conditional Formatting: Trying to apply CF with if(countif( and it's not working

    Change your formula to:

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


    This will also work

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


    The "1" makes the 1 a text value and that is what is causing the problems.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  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,929

    Re: Conditional Formatting: Trying to apply CF with if(countif( and it's not working

    If you tried the =sum() rule on this...
    =IF(ISBLANK(F15),"",IF(F15=A15,"","1"))

    It wont work because your "1" is text, not a value. Remove the ""...
    =IF(or(F15="",F15=A15),"",1))

+ 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. VBA Conditional Formatting Works But Won't Apply
    By daedelous00 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-11-2012, 01:58 PM
  2. [SOLVED] Want to apply conditional formatting
    By mshtuhin in forum Excel General
    Replies: 5
    Last Post: 07-04-2012, 07:41 AM
  3. Replies: 1
    Last Post: 11-12-2010, 03:18 PM
  4. Replies: 2
    Last Post: 09-02-2009, 07:46 AM
  5. CountIF + Conditional Formatting not working
    By Editz in forum Excel General
    Replies: 5
    Last Post: 04-17-2007, 10:49 AM

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