+ Reply to Thread
Results 1 to 2 of 2

COUNTIF Problems

  1. #1
    PW11111
    Guest

    COUNTIF Problems


    Hi,

    I have the following formula:

    =IF(ISERROR(COUNTIF(StatusCheck, "Snag Item")/COUNTIF(ElementCount,"Main
    Contractor - Builderswork")),0,COUNTIF(StatusCheck, "Snag
    Item")/COUNTIF(ElementCount,"Main Contractor - Builderswork"))

    Originally I had some problems getting ISERROR to work properly - but this
    is sorted now.

    The formula is supposed to count the number of times a snagging item is
    added into the spreadsheet (each snagging item has its own row) that is
    assigned a status of "Snag Item" and an Element of "Main -Contractor -
    Builderswork". The formula works fine for one item - but if two or more are
    added the formula returns 1.

    Any ideas why this is not working.?

    Cheers,

    Phil

  2. #2
    Damon Longworth
    Guest

    Re: COUNTIF Problems

    What do you mean by "two or more are added"?

    I am guessing you were getting an error because the formula was dividing by
    zero. You could check for zero instead of duplicating the entire formula.
    Not a big deal unless you have a large file with many formula.

    Try:

    =IF(COUNTIF(ElementCount,"Main Contractor -
    Builderswork")<>0,COUNTIF(StatusCheck, "Snag
    Item")/COUNTIF(ElementCount,"Main Contractor - Builderswork"))


    --
    Damon Longworth

    Don't miss out on the 2005 Excel User Conference
    Sept 16th and 17th
    Stockyards Hotel - Ft. Worth, Texas
    www.ExcelUserConference.com


    "PW11111" <[email protected]> wrote in message
    news:[email protected]...
    >
    > Hi,
    >
    > I have the following formula:
    >
    > =IF(ISERROR(COUNTIF(StatusCheck, "Snag Item")/COUNTIF(ElementCount,"Main
    > Contractor - Builderswork")),0,COUNTIF(StatusCheck, "Snag
    > Item")/COUNTIF(ElementCount,"Main Contractor - Builderswork"))
    >
    > Originally I had some problems getting ISERROR to work properly - but this
    > is sorted now.
    >
    > The formula is supposed to count the number of times a snagging item is
    > added into the spreadsheet (each snagging item has its own row) that is
    > assigned a status of "Snag Item" and an Element of "Main -Contractor -
    > Builderswork". The formula works fine for one item - but if two or more
    > are
    > added the formula returns 1.
    >
    > Any ideas why this is not working.?
    >
    > Cheers,
    >
    > Phil




+ 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