+ Reply to Thread
Results 1 to 3 of 3

Countifs based on cell value and date range

  1. #1
    Forum Contributor
    Join Date
    07-10-2012
    Location
    United States
    MS-Off Ver
    Office 365
    Posts
    399

    Countifs based on cell value and date range

    Hello,

    I am missing something in the following countifs formula.

    I am looking to Count all cells with a value of "D" and between a date range in column X.

    =COUNTIFS('Survey Data'!A2:A500000="D",'Survey Data'!X2:X500000,">="&B2,'Survey Data'!X2:X500000,"<="&C2)

    I appreciate any help fixing the formula.

    Thank you,
    Nick

  2. #2
    Forum Contributor
    Join Date
    07-10-2012
    Location
    United States
    MS-Off Ver
    Office 365
    Posts
    399

    Re: Countifs based on cell value and date range

    Fixed,

    =COUNTIFS('Survey Data'!A2:A500000,"D",'Survey Data'!X2:X500000,">="&B2,'Survey Data'!X2:X500000,"<="&C2)

  3. #3
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,732

    Re: Countifs based on cell value and date range

    EDIT
    you seem to have fixed

    Ignore - I see now
    you replaced the = with a ,
    =COUNTIFS('Survey Data'!A2:A500000 = "D",'Survey Data'!X2:X500000,">="&B2,'Survey Data'!X2:X500000,"<="&C2)
    to
    =COUNTIFS('Survey Data'!A2:A500000 , "D",'Survey Data'!X2:X500000,">="&B2,'Survey Data'!X2:X500000,"<="&C2)

    the formula looks ok
    BUT whats in B2 and C2 - i assume a date - correctly formatted as a date
    AND
    the contents of
    'Survey Data'!X2:X500000
    column X is actually dates as well and NOT text

    click on column
    'Survey Data'!X2:X500000
    change the format to General
    ALL the cells should change to just a number
    44737 is the 25th June 2022
    number of days from 1900 - which is how excel works dates
    so as its almost midnight in UK
    tomorrow - 26th June 2022 will be
    44738

    Note: Images are difficult to see , and also requires that I input all the data myself, which is very time consuming.

    A sample sheet would help here


    Please see the Yellow Banner at the top of the page explaining how to attach a sample spreadsheet

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, relevant cells highlighted and a few explanatory notes.

    Here are the instructions, found at the top of the page again
    Post a small Excel sheet (not a picture) showing realistic & representative sample data WITHOUT confidential information (10-20 rows, not thousands...) and some manually calculated results. For a new thread (1st post), scroll to Manage Attachments, otherwise scroll down to GO ADVANCED, click, and then scroll down to MANAGE ATTACHMENTS and click again. Now follow the instructions at the top of that screen.
    Last edited by etaf; 06-25-2022 at 06:39 PM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA to copy a formula from a cell range and paste it to a cell range based on date
    By dedark05 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-19-2019, 04:41 AM
  2. Countifs match criteria and date is equals to or within date range
    By tiggi in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-28-2016, 11:00 AM
  3. Replies: 2
    Last Post: 05-28-2014, 06:52 AM
  4. VBA to enter date range based on date range in above cell
    By Pierce Quality in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-19-2013, 08:45 AM
  5. [SOLVED] COUNTIFS with Date Range
    By whizbee in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 10-28-2013, 03:44 PM
  6. Using countifs with date range, and summing values in that range
    By bmcoonan in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-30-2013, 11:28 AM
  7. Replies: 0
    Last Post: 12-16-2011, 09:01 AM

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