+ Reply to Thread
Results 1 to 6 of 6

Count by color font help

  1. #1
    Forum Contributor
    Join Date
    07-15-2011
    Location
    Whitby, Canada
    MS-Off Ver
    Excel 2010
    Posts
    121

    Count by color font help

    Need help to count by font color -
    I have added a module from this site to 'count by font color' which works well at home with my Excel 2010 version, but when I try to use it at work (Excel 2003) it malfunctions in 2 ways.
    First, the formula 'GetFontColorIndex' for automatic (black) returns -4105, which I am not sure about as I thought it should be 1, but the non-automatic (black) returns the number 1so I am at a loss....
    Second, with the command 'CountFontColor' I end up counting all cells in the range, including the cells that are blank, which I do not want.... Any help would be much appreciated!
    Last edited by Greed; 07-18-2011 at 10:20 AM. Reason: Solved

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: Count by color font help

    I am not sure whether I am correct.

    excel 2007 and above have provision for counting color fonts but excel 2003 does not have;. In excel 2003 your have to write a user defined function. see this url

    http://www.techonthenet.com/excel/qu...font_color.php

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Count by color font help

    See this post

    http://www.excelforum.com/excel-gene...ill-color.html

    Also, most important, remember these functions will not work with colours generated by Comditional Formatting
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,706

    Re: Count by color font help

    Here is a valuable tutorial on the subject

    http://www.datapigtechnologies.com/f...rtonColor.html

    Alan
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Registered User
    Join Date
    03-22-2005
    Posts
    31

    Re: Count by color font help

    Hi,

    I use 2003 and use this function quite frequently.

    The UDF I use is:

    Please Login or Register  to view this content.
    To use it enter:

    =countfontcolour(Colour_Sample,Cell_Range)

    so if A1 contains the colour you want to count (eg. Value with Red Font) and D1:D50 is the range you want to count those with red font then use it like so:

    =countfontcolour(A1,D1:D50)

    Thanks

  6. #6
    Forum Contributor
    Join Date
    07-15-2011
    Location
    Whitby, Canada
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Count by color font help

    Thanks everyone - I already had the module insterted and counting, the bigger problem was that it was counting BLANK cells also, which I did not want, but had to include in the range since I was creating the spreadsheet to be used by others. I finally changed the formula to subtract the blanks - kind of messy but I couldn't see any other way. I think it might have been easier if I was counting a colour, rather than automatic black.....
    The formula looks like this:
    =CountFontColor(A4:A15,-4105)-COUNTIF(A4:A15,"")

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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