+ Reply to Thread
Results 1 to 7 of 7

Count last 7 days of pupil attendance that exceeds 31

  1. #1
    Registered User
    Join Date
    05-30-2015
    Location
    london england
    MS-Off Ver
    micro off 2010
    Posts
    4

    Count last 7 days of pupil attendance that exceeds 31

    Hi all


    was after some help with an excel formula!!! does anyone know what formula I would use to adjust the starting point of its criteria for example if I had a spreadsheet of pupil attendance by day but then wanted a formula to show how many days I had 31 pupils in but only counting for the last 7 days(values)? so then each time I add a new value it would still only count back 7 days.
    if the starting point was the same I would use COUNTIF(Sheet1!B:C,31) but how do I add only count the last 7 values without having to adjust the formula each time I add a value. as below

    day 1 - 30
    day 2 - 34
    day 3 - 31
    day 4 - 32
    day 5 - 31
    day 6 - 31
    day 7 - 33

    so when I add day 8 it would only count days 2,3,4,5,6,7 and 8. then when I add day 9 it will count days 3,4,5,6,7,8 and 9.

    thank you in advance for any help
    Last edited by Richard Buttrey; 05-30-2015 at 09:23 AM. Reason: Inadequate title

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: formulas

    Hi and welcome to the forum. Unfortunately your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (I'll change the title for you on this occasion since this is your first post, but please remember for the future.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: formulas

    Try this:

    =COUNTIF(OFFSET($B$1,LOOKUP(2,1/(ISNUMBER($B$1:$B$200)),ROW($A1:$A200))-7,0,7),">="&31)
    Last edited by Glenn Kennedy; 05-30-2015 at 09:55 AM.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Count last 7 days of pupil attendance that exceeds 31

    =COUNTIF(INDEX(B:B,LOOKUP(9^9,B:B,ROW(B:B))-6):INDEX(B:B,LOOKUP(9^9,B:B,ROW(B:B))),">="&31)
    Try the above if not worked attach sample excel file
    Please Login or Register  to view this content.
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Count last 7 days of pupil attendance that exceeds 31

    @ Richard Buttrey, I am sorry, I did't see your post regarding change title,
    wilson23 pls edit your thread title as suggested by Rechard buttrey

  6. #6
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Count last 7 days of pupil attendance that exceeds 31

    For the last record use the formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    For the line online registration use the formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I attached the file Sample_4
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    05-30-2015
    Location
    london england
    MS-Off Ver
    micro off 2010
    Posts
    4

    Re: Count last 7 days of pupil attendance that exceeds 31

    hi

    thank you Glenn works an absolute treat! it is greatly appreciated and will add reputation accordingly

    sorry nflsales and jose Glenn got there first but im sure your way would have been just as effective

+ 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. Poll on - Lots of simple formulas vs fewer but more complex formulas
    By gassiusmax in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-20-2014, 08:51 PM
  2. Using Cell references in file paths for formulas to create dynamic formulas
    By MichaelStokesJr in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-04-2013, 11:49 AM
  3. Insert cells, fill formulas down, set formulas for dynamic range
    By Snickers65 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2013, 01:43 PM
  4. Replies: 5
    Last Post: 09-25-2013, 02:51 PM
  5. Replies: 5
    Last Post: 05-05-2008, 02:22 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