+ Reply to Thread
Results 1 to 2 of 2

Dynamic: Adding up the previous 3 rows from a given cell

  1. #1
    Registered User
    Join Date
    01-24-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    1

    Arrow Dynamic: Adding up the previous 3 rows from a given cell

    Hi guys,

    Objective: Track attendance for the past 3 days from today.
    MS Excel Version: 2007

    Simplified table:

    Dates Total no. of Days Present Attendance %
    20/01/2014 1 1 100
    21/01/2014 2 2 100
    22/01/2014 3 2 66
    23/01/2014 4 3 75
    24/01/2014 5 4 80

    To get the % of attendance: =(D3/C3)*100
    To get today's date: =TODAY()
    To match today's date with Dates column: =INDEX($F$3:$F$19,MATCH($K$7,$B$3:$B$19,1))

    All of the above works fine and it returns the Attendance % on that given day.

    This is where it gets tricky: how do I ONLY add the two previous days with today's attendance and divide by 3?

    The answer that the formula should give is 74% of attendance (e.g. 66+75+80 / 3).

    I hope that this makes sense!

    Thanks for your time.
    Dreamer12.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Dynamic: Adding up the previous 3 rows from a given cell

    try:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

+ 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. Adding to VBA code to copy a cell in the previous column
    By ChurchillClaire in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-02-2012, 09:07 AM
  2. Adding and subtracting to a cell's previous value
    By elimelim in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 04-09-2012, 02:52 PM
  3. Adding working cell to a previous cell
    By jeffige in forum Excel General
    Replies: 5
    Last Post: 02-19-2011, 07:26 PM
  4. Macro for adding rows after previous row?
    By xwishmasterx in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-17-2010, 07:28 PM
  5. Adding specific data depending on previous column cell value
    By Gerhard Kriek in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-09-2009, 05:32 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