+ Reply to Thread
Results 1 to 5 of 5

Returning a 0 finding when multible criterion does not match

  1. #1
    Registered User
    Join Date
    04-12-2012
    Location
    Kariong, NSW
    MS-Off Ver
    Excel 2003
    Posts
    32

    Returning a 0 finding when multible criterion does not match

    Hi Everybody,
    This is my first post and I need your assistance. I have a spreadsheet created in Excel 2003 (see attached) that seems to work OK as long as at least 1 field of A2:A4 is tagged as Open. The object being for a number to appear in F2
    What I would like to achieve if it is possible, is to extent the formula for F2 to return a 0 value if all A2:A4 fields equal Closed.

    Hope you can help
    Steve
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,695

    Re: Returning a 0 finding when multible criterion does not match

    =IF(COUNTIF(A2:A4, "closed")=3,0,SUMIF(...
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    04-12-2012
    Location
    Kariong, NSW
    MS-Off Ver
    Excel 2003
    Posts
    32

    Re: Returning a 0 finding when multible criterion does not match

    TMShucks,
    Thanks for the quick reply but I must be doing something wrong. I have entered your formula (I think) but do not seem to be getting the right result.
    The system wants to add an additional ')' at the end of the formula I eneter and then returns a value of #DIV/0! (again).

    Steve
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    04-12-2012
    Location
    Kariong, NSW
    MS-Off Ver
    Excel 2003
    Posts
    32

    Re: Returning a 0 finding when multible criterion does not match

    Hey Everybody,
    Just found the answer to my problem. Here is the formula: =IF((E2=0),0,(SUMIF(A2:A4,"Open",D2:D4)/E2))

    Thanks for your help
    Steve

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,695

    Re: Returning a 0 finding when multible criterion does not match

    Thanks for sharing the answer.

    You could modify my suggestion and eliminate E2 from the calculation:

    =IF(COUNTIF(A2:A4,"open")=0,0,SUMIF(A2:A4,"Open",D2:D4)/COUNTIF(A2:A4,"Open"))

    Note: apologies for assuming they'd be all "closed" ... I took the original post literally

    the formula for F2 to return a 0 value if all A2:A4 fields equal Closed

+ 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