+ Reply to Thread
Results 1 to 4 of 4

Formula to count Cell colour.

  1. #1
    Registered User
    Join Date
    05-22-2005
    Posts
    38

    Formula to count Cell colour.

    Morning all,
    I am looking to set up a formula to count cells IF they are a filled with a specific colour. Is this possible as i cannot find any way to ask to countif - eg green.
    I have tried everything i could think of - =COUNTIF(C5:BI24,(GREEN))
    Any help will be greatly appreciated.
    James

  2. #2
    Forum Contributor
    Join Date
    02-26-2005
    Posts
    175
    Quote Originally Posted by themax16
    Morning all,
    I am looking to set up a formula to count cells IF they are a filled with a specific colour. Is this possible as i cannot find any way to ask to countif - eg green.
    I have tried everything i could think of - =COUNTIF(C5:BI24,(GREEN))
    Any help will be greatly appreciated.
    James
    Hi,
    See if you can find an answer here.

    http://www.xldynamic.com/source/xld.ColourCounter.html

    Dave

  3. #3
    Registered User
    Join Date
    05-22-2005
    Posts
    38
    Thanks for that.. one final thing... how do you enter UDF?
    thanks
    James

  4. #4
    Naz
    Guest

    Re: Formula to count Cell colour.

    You go into VBA Tools>Macros>Visual Basic Editor
    In a module instead of Sub() and End Sub which you normally use you type

    Function NameOfFunction(enter here seperated by commas, any cells the
    function will use)

    NameOfFunction= expression

    End function

    E.g say you wanted to calculate tax you could write this unction

    Function Tax(Cell1,Cell2)

    Tax = Cell1 * Cell2

    End Function

    The in the spreadsheet your formula would be

    =Tax(cell you want to calculate tax for, cell with the tax rate )
    so if the value cell was A1 (100) and B1 (10%) had the tax rate

    =Tax(A1,B1)

    gives

    10 (100*.1)

    --

    _______________________
    Naz,
    London


    "themax16" wrote:

    >
    > Thanks for that.. one final thing... how do you enter UDF?
    > thanks
    > James
    >
    >
    > --
    > themax16
    > ------------------------------------------------------------------------
    > themax16's Profile: http://www.excelforum.com/member.php...o&userid=23622
    > View this thread: http://www.excelforum.com/showthread...hreadid=374893
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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