+ Reply to Thread
Results 1 to 5 of 5

Counting data across multiple cells using a cell specific formula in countif

  1. #1
    Registered User
    Join Date
    06-19-2015
    Location
    New York City
    MS-Off Ver
    Microsoft Excel 2007
    Posts
    2

    Counting data across multiple cells using a cell specific formula in countif

    I need to count all instances of dates within 6 days of a fixed date. Trouble is, I need to do all this within one cell and without creating another table column. I have attempted to use a days360 function inside of a countif function to do this, but that only works for one cell at a time. How do I count all instances of those dates using a single cell and without creating another table column?

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,152

    Re: Counting data across multiple cells using a cell specific formula in countif

    Can you post a sample workbook showing expected results.

  3. #3
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Counting data across multiple cells using a cell specific formula in countif

    Try using COUNTIFS?

    Assume your range of dates is in column A, and your fixed date is in cell B1, then you could do something like this:

    =COUNTIFS(A:A,">="&B1,A:A,"<="&B1+6)

    That will return the count of all cells with dates that are equal to, or within 6 days following the date in cell B1.

    - Moo

  4. #4
    Registered User
    Join Date
    06-19-2015
    Location
    New York City
    MS-Off Ver
    Microsoft Excel 2007
    Posts
    2

    Re: Counting data across multiple cells using a cell specific formula in countif

    =COUNTIFS(A:A,">="&B1,A:A,"<="&B1+6) worked perfectly

    What is the function of the ampersand in this case? Why does it only work as "<="&B1,A:A?

  5. #5
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Counting data across multiple cells using a cell specific formula in countif

    You need the ampersand to concatenate the comparison operators ( < > = ) with the cell reference ( B1 ). This is because Excel treats the comparison operators as text strings. So, you are concatenating "<=" and the contents of cell B1 for the criteria.

    If you wanted to compare a value, you could use: =COUNTIFS(A:A,"<50"...), or if you wanted to match cells that were exactly 73, you could just use =COUNTIFS(A:A,73...)

    Hope that explanation helps. =)

    - Moo

+ 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] COUNTIF search range of cells for multiple specific text.
    By JasonNeedsHelp in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-08-2013, 06:38 PM
  2. Replies: 4
    Last Post: 04-25-2013, 03:53 AM
  3. Replies: 4
    Last Post: 06-22-2012, 11:44 AM
  4. Counting data on multiple sheets using countif
    By nickelcell1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-08-2010, 03:05 PM
  5. My Countif formula is not accurately counting- Need to cound blank cells
    By mrgillus in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-10-2009, 02:59 PM

Tags for this Thread

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