+ Reply to Thread
Results 1 to 6 of 6

COUNTIF with more than one logical argument. COUNTAND perhaps?

Hybrid View

  1. #1
    Registered User
    Join Date
    03-04-2012
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    6

    COUNTIF with more than one logical argument. COUNTAND perhaps?

    Hello

    I am struggling with a problem where I need to count the instances of something based on 2 logical arguments. I'm writing a spreadsheet to keep track of invoices and I want to monitor which clients regularly pay late and by how much.

    I would like a COUNTIF function to count how many times client A pays an invoice >0 days past the due date. So I have columns containing client name (A), date invoice is due (B), date invoice is paid (C) and difference between the two dates (D). I would like to count how many times client A appears in column A with column D >0. Essentialy =COUNTIF(A:A,"Client A" AND D:D,>0) but of course this syntax is not correct.

    Does anyone have any suggestions on how I can achieve a COUNTIF with 2 logical arguments?

    Thanks

  2. #2
    Registered User
    Join Date
    03-04-2012
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: COUNTIF with more than one logical argument. COUNTAND perhaps?

    ...also...does a MAXIF function exist? For example find the maximum value in column D where column A is equal to "Client A"

    Thanks

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,792

    Re: COUNTIF with more than one logical argument. COUNTAND perhaps?

    Try SUMPRODUCT for a multi-condition count, although you can't use the whole column as you can with COUNTIF. For example

    =SUMPRODUCT((A2:A100="Client A")*(D2:D100>0))

    and for MAX with conditions try an "array formula"

    =MAX(IF(A2:A100="Client A",D2:D100))

    the latter confirmed with CTRL+SHIFT+ENTER
    Audere est facere

  4. #4
    Registered User
    Join Date
    03-04-2012
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: COUNTIF with more than one logical argument. COUNTAND perhaps?

    Thank you! The SUMPRODUCT works with a little bit of tweaking.

    I cant get the conditional MAX to work. Not sure what you mean by confirm with ctrl shift and enter. Working on a Mac so don't know if that affects anything to do with the ctrl/apple key.

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,792

    Re: COUNTIF with more than one logical argument. COUNTAND perhaps?

    On a Mac I believe you need Command+Return instead. If done correctly you get curly braces like { and } around the formula. As an alternative you can add an INDEX function then the formula can be entered like any other, i.e.

    =MAX(INDEX((A2:A100="Client A")*D2:D100,0))

    No text allowed in D2:D100

  6. #6
    Registered User
    Join Date
    03-04-2012
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: COUNTIF with more than one logical argument. COUNTAND perhaps?

    I got it to work with APPLE+SHIFT+ENTER and the curly brackets did indeed appear. Thanks for your help! The whole sheet is running perfectly now.

+ 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