+ Reply to Thread
Results 1 to 6 of 6

Counting occurences if between specific date range

  1. #1
    Forum Contributor
    Join Date
    01-09-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    1,192

    Counting occurences if between specific date range

    I have an attendance tracker and I want to be able to select a date range and then have the sum available. The Data Validation worksheet shows the value each has, but i've included below for reference too. The table at the top does something similar, it counts a point if it is within the last six months and assigns a point based on the code. The worksheet "Aaron" is where I have comments/notes and such to help. The pivot table would be replaced with your formula. It is just for show.

    So basically, I need the formula to look between the range of dates, and if an occurrence is listed, add them together. Since there are only three events with points, then i guess you could ignore the other letter codes.



    UA 1
    40 0
    AL 0.5
    DR 0
    GP 0
    LE 0.5
    PTO 0
    SU 0
    UA+ 0
    UE 0
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,625

    Re: Counting occurences if between specific date range

    Pl explain manually showing the calculation details how the above points are arrived.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  3. #3
    Forum Contributor
    Join Date
    01-09-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    1,192

    Re: Counting occurences if between specific date range

    I'm not 100% sure on what he exactly are requesting, so please let me know if my answer doesn't help. Points are totaled based on if they fall within the date range. A manager manually inputs if an employee was absent or late or left early. When the manager selects UA/AL/LE then a point value is assigned. Every UA is 1 point, every AL or LE is 1/2 point.

  4. #4
    Forum Contributor
    Join Date
    01-09-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    1,192

    Re: Counting occurences if between specific date range

    It would look something like this: =SUMIFS(LE22:LJ22,LE21:LJ21,">="&B22,LE21:LJ21,"<="&C22)

    issue is that it needs to recognize the letter code ("AL") a know to make that a .5

    I found this online, =SUM(COUNTIF(LE22:LJ22,{"UA","AL","LE"})*{1,0.5,0.5}), and it works but it requires a date range criteria now
    Last edited by taylorsm; 01-10-2018 at 12:30 PM.

  5. #5
    Forum Contributor
    Join Date
    01-09-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    1,192

    Re: Counting occurences if between specific date range

    There may be a better way (sure there is), but because no one else has been able to help so far, i came up with this.

    =SUM(SUM(COUNTIFS(LE22:LJ22, "="&E7, LE21:LJ21,">="&B22, LE21:LJ21,"<="&C22)),SUM(COUNTIFS(LE22:LJ22, "="&F7, LE21:LJ21,">="&B22, LE21:LJ21,"<="&C22)*0.5), SUM(COUNTIFS(LE22:LJ22, "="&G7, LE21:LJ21,">="&B22, LE21:LJ21,"<="&C22)*0.5))

    anyone have something better/faster?

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,625

    Re: Counting occurences if between specific date range

    Try this
    In B25
    Please Login or Register  to view this content.
    In C25
    Please Login or Register  to view this content.

+ 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] Counting Specific Text Occurences in Cells Adjacent to Particular Values
    By lowlybroker in forum Excel General
    Replies: 7
    Last Post: 10-21-2013, 12:07 PM
  2. counting occurences of a country name in a specific column
    By tryer in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 06-21-2013, 01:04 PM
  3. [SOLVED] Counting Occurences in a Range based on Specific Criteria
    By artikyulashun in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-24-2012, 12:23 PM
  4. Counting number of occurences specific date in range of cells in a table
    By jzzman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2009, 01:47 AM
  5. counting occurences of values relating to date range
    By Newport Count in forum Excel General
    Replies: 11
    Last Post: 10-24-2009, 06:53 AM
  6. Counting Occurences W/in Specific Date Range
    By screamnyak in forum Excel General
    Replies: 2
    Last Post: 09-14-2009, 03:29 PM
  7. [SOLVED] Counting specific word occurences in a cell
    By KenRamoska in forum Excel General
    Replies: 3
    Last Post: 08-03-2006, 01:50 PM
  8. [SOLVED] Counting occurences of a specific day between two dates
    By coal_miner in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-20-2005, 11:06 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