+ Reply to Thread
Results 1 to 8 of 8

limited countif

Hybrid View

  1. #1
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: limited countif

    In most cases INDEX can be used in preference to volatiles like OFFSET and INDIRECT... the latter not so when the sheet reference is a dynamic variable. OFFSET is sometimes easier from a syntax perspective but wherever possible I adopt INDEX.
    (should add that INDEX gives impression of being Volatile but in reality is not)

    In short INDEX is incredibly powerful (& flexible) but is also slow if used on large ranges... eg

    =SUM(INDEX((A1:A10000="a")*(B1:B10000="b")*C1:C10000,0))

    is likely to prove slower than a SUMPRODUCT / CSE

    =SUMPRODUCT((A1:A10000="a")*(B1:B10000="b")*C1:C10000)
    =SUM(IF((A1:A10000="a")*(B1:B10000="b"),C1:C10000))) - CSE

  2. #2
    Registered User
    Join Date
    04-06-2009
    Location
    Austin, TX
    MS-Off Ver
    Excel 2007
    Posts
    34

    Cool Re: limited countif

    I went ahead and used this formula on my actual workbook (very different from the sample uploaded). I substituted the 2 for a 3 I am starting in row 4.

    =COUNTIF(INDIRECT("$O$4:O"&(3+MATCH(1,O4:O15,1))),"0")

    This works well for my first calculations on how many months nothing is paid.

    Everything works perfectly until the term ends and the amount reverts back to zero.

    Currently, I am using a simple countif function to count months with the corresponding rate. After the rent term has started, I would like for excel to count the months only if a dollar amount is listed.

    Basically, count the number of months that the amount in O4:O123 is the same as in J21 but do not count if that amount is "0"

    Sorry about this confusion.

+ 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