+ Reply to Thread
Results 1 to 7 of 7

Multi-criteria countif functions for dates...possible?

  1. #1
    Registered User
    Join Date
    10-10-2006
    Posts
    9

    Multi-criteria countif functions for dates...possible?

    This is a problem I've been trying to work out...and I am currently at my wit's end.

    This may be a little murky but I'll try to make it as clear as possible (feel free to ask for clarification on any of it if you think you could help).

    I've got two tabs of and Excel sheet "Data" and "Summary".

    The Data tab contains 4 columns:
    A - a shipment date (mm/dd/yy)
    B - a return date (or current date if not returned yet - also mm/dd/yy)
    C - a calculation of months in the "field" as a function of MONTH B-A
    D - if the shipment was returned, the # months in the field from column C, otherwise blank
    Each row is a separate shipment, and there's lots of them!

    The Summary tab also contains 4 columns:
    A - the first date of every month (mm/dd/yy)
    B - a calculation (count) of shipments for the month starting with date listed in A from all the shipments in Data-A
    C (this is what I need help with) - need a formula to calculate the count of all occurences in Data-D that fall between 0 and 2 (returns within 2 months of shipment) for that month (as specified in Summary-A)
    D (also need help witht his one) - similar to C above, but a count of returns within 3-12 months for that same month

    Is there a worksheet function that can accomplish this?
    I'd like to avoid using macro's or pivot tables.

    Thanks.

  2. #2
    Registered User
    Join Date
    09-18-2006
    Posts
    67
    Try this in "Summary" sheet column C (Assumes data in "Data" starts in row 2 and ends in row 5:

    =SUM(IF((MONTH(Data!$A$2:$A$5)=MONTH(E2))*(YEAR(E2)=YEAR(Data!$A$2:$A$5))*(Data!$D$2:$D$5>=0)*(Data!$D$2:$D$5<=2),1))

    Use CNTRL-SHIFT-ENTER and fill down.

    - Clay Ver Valen
    Excel Help

  3. #3
    Registered User
    Join Date
    10-10-2006
    Posts
    9
    Thanks Clay,
    I C&P the formula and changed your reference from E to A (cell where the date is) as well as the row count from 5 ro 1067 (which is what it is), and it returns a value of 1...which is incorrect, it sould be higher than that...

    Not sure if I misunderstood your suggestion.
    Rekli

  4. #4
    Registered User
    Join Date
    09-18-2006
    Posts
    67
    Did you enter the formula with CNTRL-SHIFT-ENTER?

    - Clay

  5. #5
    Registered User
    Join Date
    10-10-2006
    Posts
    9
    Just tried it, now it gives me 118 which is way too high.

    Here's the file it if makes things easier:
    http://cjoint.com/?klxmUESqZ0

    Thanks Clay,
    Rekli

  6. #6
    Registered User
    Join Date
    09-18-2006
    Posts
    67
    Sorry, thought you'd have a formula in column D. Use the following:

    =SUM(IF(NOT(ISBLANK(Data!$D$2:$D$1657))*(MONTH(Data!$A$2:$A$1657)=MONTH(A2))*(YEAR(A2 )=YEAR(Data!$A$2:$A$1657))*(Data!$D$2:$D$1657>=0)*(Data!$D$2:$D$1657<=2),1))

    With CNTRL-SHIFT-ENTER

    - Clay Ver Valen
    Excel Help

  7. #7
    Registered User
    Join Date
    10-10-2006
    Posts
    9
    That worked beautifully...thanks Clay!

+ 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