+ Reply to Thread
Results 1 to 5 of 5

MS Office 2010: Need help with CountIfs function, multiple ranges and a date as criteria

  1. #1
    Forum Contributor
    Join Date
    12-06-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    201

    MS Office 2010: Need help with CountIfs function, multiple ranges and a date as criteria

    I need to count how many times a specific date occurs in multiple ranges.

    I have multiple columns with dates, nine per year to be exact. There are however columns with other values inbetween.

    Each year has columns for:
    Interim - Declared (Col C - Date)
    Interim - LDT (Col D - Date)
    Interim - Payment (Col E - Date)
    Interim - Amount (Col F - Number)
    Final - Declared (Col G - Date)
    Final - LDT (Col H - Date)
    Final - Payment (Col I - Date)
    Final - Amount (Col J - Number)
    Special - Declared (Col K - Date)
    Special - LDT (Col L - Date)
    Special - Payment (Col M - Date)
    Special - Amount (Col N - Number)

    I need to count how many times a specific date occurs in the LDT columns only.

    How do I enter the criteria for a date?

    While trying to figure out the CountIfs function syntax I used the numeric values columns:
    Entering CountIfs(F5:F120,95) answer is 3
    Entering CountIfs(F5:F120,95,J5:J120,95) answer is 0 when it should at least be 3???

    If it doesn't work with one year how is it going to work with multiple years?

    What an I doing wrong? How do I do this?

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,086

    Re: MS Office 2010: Need help with CountIfs function, multiple ranges and a date as criter

    can we see a sample spreadsheet

    your date appears to be in a lot of different columns -which is going to make this a little difficult

    CountIfs(F5:F120,95,J5:J120,95)
    Thats an AND statement

    so as an example if in F5 you have 95 , then to count J5 will also need to have 95 in

    so look at the three results you had for just the F column and make sure in the same row J also has 95 - if it does then the formula is not working correctly - but if J does not have 95 for those 3 rows in F - then 0 will be the result

  3. #3
    Forum Contributor
    Join Date
    12-06-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: MS Office 2010: Need help with CountIfs function, multiple ranges and a date as criter

    I need an OR statement. An AND statement is not going to work for me.

    I need to know if a specific date is in any one of the cells in the specific ranges supplied.

    Any ideas?

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,086

    Re: MS Office 2010: Need help with CountIfs function, multiple ranges and a date as criter

    use countif

    CountIf(F5:F120,95)+CountIf(J5:J120,95)

    so that will count all the F's and all the J's

    But do you want to count as 2 if the same row for J and F have 95

    not really sure what you are trying to do here with the 95

    i must be missing the format - can you load a sample spreadsheet

  5. #5
    Forum Contributor
    Join Date
    12-06-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: MS Office 2010: Need help with CountIfs function, multiple ranges and a date as criter

    It's a huge spreadsheet.

    Eventually I'm going to do this from VBA. All I want to know is if the specific date does occur in any one of the columns. If it does occur once (or more) then I loop through the columns to find the specific date and then do the calculations I need to do.

    I'm trying to avoid looping through the huge table and not finding the date. Previously I used the CountIf function and supplied the whole range as one range and it returned how many times a date occurred. If this was one or more times then I go and find them and work with them. Unfortunately they added several date columns so I can't pass the whole range as one range anymore. The other columns might have the date in but it's not applicable to my needed columns.

+ 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