+ Reply to Thread
Results 1 to 8 of 8

counting date ranges

  1. #1
    Registered User
    Join Date
    07-16-2012
    Location
    Utah
    MS-Off Ver
    365 ver. 2210
    Posts
    34

    counting date ranges

    I have a spreadsheet that has multiple sheets and one of the sheets titled "data" is my data source. I have a sheet called "January" that has a list of customers, what I need it to take from the "data" sheet how many times that customer is listed and how many times that customer is listed from January. I have attached a sample
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: counting date ranges

    This will work for you, copied down...
    =SUMPRODUCT(--(TRIM(Data!$B$2:$B$34486)=January!A2),--(MONTH(Data!$A$2:$A$34486)=1))

    You will need to change the 1 at the end for each sheet (Im still working on that part though)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: counting date ranges

    duh, major brain phart lol

    In E1 put this (on each sheet)...
    =MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255)

    then use this, copied down
    =SUMPRODUCT(--(TRIM(Data!$B$2:$B$34486)=January!A2),--(TEXT(Data!$A$2:$A$34486,"mmmm")=$E$1))

  4. #4
    Registered User
    Join Date
    07-16-2012
    Location
    Utah
    MS-Off Ver
    365 ver. 2210
    Posts
    34

    Re: counting date ranges

    @DFibbins, thank you for the help...where you have filename what do you mean by that? what file name?

  5. #5
    Registered User
    Join Date
    07-16-2012
    Location
    Utah
    MS-Off Ver
    365 ver. 2210
    Posts
    34

    Re: counting date ranges

    @DFibbins, I put the sum product formula in the sheet and it worked perfectly, im not sure what you want me to do with the MID formula and why?

  6. #6
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,887

    Re: counting date ranges

    Hi,


    I have observed the data discipline in data sheet and to other sheets, as per my observation they are not matching, i mean we are able to search but the length of the string is varying which is added by spaces etc.please clear that and check with the solution which i have provided in the attachment.


    Punnam

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: counting date ranges

    @ Utahguy, that formula pulls inteh sheet name - which is then used as the month criteria. I put that in E1 to pull in the sheet name so that you dont have to hard-code the month name in the formula
    =MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255)

    @ Punnam, sometimes thats just how the data comes in The TRIM() function generally takes care of leading and trailing spaces

  8. #8
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,887

    Re: counting date ranges

    Hi utahguy9384 ,

    The file size is more than 1mb i am not having send it in Forum, if any mail id i will be able to send you a copy.

    Punnam

+ 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. Counting based on date ranges
    By smohyee in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 08-09-2013, 09:56 AM
  2. [SOLVED] Counting Days within multiple date ranges
    By cweideman in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-19-2013, 11:07 AM
  3. [SOLVED] Counting the number of times a date occurs in multiple start and end date ranges.
    By Grizz in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 03-05-2013, 04:41 PM
  4. Need help counting events within a certain date ranges
    By i.suck.at.excell in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-25-2012, 11:32 PM
  5. Counting date ranges that have a certain criteria
    By TaleahaD in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-10-2012, 06:19 PM

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