+ Reply to Thread
Results 1 to 3 of 3

Looking for a more elegant solution with CountIf to evaluate formats

  1. #1
    Registered User
    Join Date
    03-04-2012
    Location
    Macau
    MS-Off Ver
    Excel 2007
    Posts
    32

    Looking for a more elegant solution with CountIf to evaluate formats

    My Goal: Count the number of cells in a range that are formatted as a percentage.

    My workaround: Using the formula =CELL("format", A1) I can duplicate a row with a series of format types (ie. P0, G, P0, N, P0) etc. Then I used the formula =COUNTIF(B1:B10,"p0") to count the number of times the format P0 shows up.

    My Plea: Can someone show me a way to evaluate the cell format within the COUNTIF formula to combine the two functions. I just can't get my head around how to apply the CELL function to the range.

    Thanks.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Looking for a more elegant solution with CountIf to evaluate formats

    Hi

    I don't believe you can apply the cell("format") construct to a range of cells, and have it apply to each cell in the range. It will, according to the help file, only action one cell.

    If you don't want to use a "helper" column, then I think the only way you will get around it is to build your own function (UDF).

    rylo

  3. #3
    Registered User
    Join Date
    03-04-2012
    Location
    Macau
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Looking for a more elegant solution with CountIf to evaluate formats

    Thanks Rylo-

    I think making my own function is over my head at this point. Your answer will allow me to stop thinking of a solution.

    Tom

+ 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