+ Reply to Thread
Results 1 to 5 of 5

COUNTIF with 2 conditions

  1. #1
    Registered User
    Join Date
    12-09-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    18

    COUNTIF with 2 conditions

    Hello

    Version: 2003

    I'd like to COUNTIF(A:A,"123") but only if the date in Column E falls within each 1/4 of the year. I'm trying to extract a figure for each 1/4 of the year.

    Could I get the formula to refer to a dates table i.e 01/04/2011, 01/07/2011, 01/10/2011, 01/01/2012 - COUNTIF(A:A,"123")*(IF(<dates table)??? Can't get it to work!!

    Any help would be great.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,040

    Re: COUNTIF with 2 conditions

    For XL2003 you can use SUMPRODUCT:

    =SUMPRODUCT(--($A$2:$A$1000=123), --($E$2:$E$1000>="1.1.2012"), --($E$2:$E$1000<"1.4.2012")

    Note:
    - it's better to use smaller range (i.e. E1:E100 or something) than full column E:E
    - all ranges must be same size (A2:A1023, E2:E1023 etc)
    - Instead of dates you can use cell references (i.e. E1)
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    12-09-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: COUNTIF with 2 conditions

    Zbor, thanks for the help but I can't get this to work. I'm using;

    =SUMPRODUCT(A1:A35="123")*(E1:E35<I31) I31 being the date - it's not picking up the correct figure. Any idea's?

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,040

    Re: COUNTIF with 2 conditions

    =sumproduct((a1:a35="123")*(e1:e35<i31))

  5. #5
    Registered User
    Join Date
    12-09-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: COUNTIF with 2 conditions

    Great thanks, much appreciated.

+ 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