+ Reply to Thread
Results 1 to 4 of 4

COUNTIF function

  1. #1
    Registered User
    Join Date
    02-07-2010
    Location
    Manchesteer
    MS-Off Ver
    Excel 2007
    Posts
    51

    COUNTIF function

    Hi,

    I am trying to be more efficient with my countif functions. I have 5 regions on a sheet that i want a formula to count how many times 'UNVAILABLE' and 'VACANT' are in the 5 regions, then subtract that number from 39. So the formula i have at the moment is

    Please Login or Register  to view this content.
    Can anyone help top condense the forumla?

    Thanks,
    Mark

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: COUNTIF function

    This would condense it but beware that INDIRECT can make it more inefficient (as it's a volatile function)

    =39-SUM(COUNTIF(INDIRECT({"B8:B14","B16:B25","I8:I14","I16:I24","P8:P13"}),{"Vacant";"Unavailable"}))
    Audere est facere

  3. #3
    Registered User
    Join Date
    02-07-2010
    Location
    Manchesteer
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: COUNTIF function

    Thanks for this.

    I have used it and it is working to a degree - it seems to break on the 'THUR' tab. See attached table - the cell that counts is T25.

    Can anyone offer a reason and (more importantly) a solution?

    Thanks,
    Mark
    Last edited by mark-ainsworth; 09-20-2010 at 12:02 PM.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: COUNTIF function

    You have a "trailing space" after "UNAVAILABLE" in B8. If you edit that out then you should get a result of 36.....or change the formula so that it looks for "vacant" and "unavailable" in amongst any other text, ie. with wildcards

    =39-SUM(COUNTIF(INDIRECT({"B8:B14","B16:B25","I8:I14","I16:I24","P8:P13"}),"*"&{"Vacant";"Unavailable"}&"*"))

    Note that this might not be appropriate for you, it would count "Not Vacant" for instance........

+ 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