+ Reply to Thread
Results 1 to 5 of 5

Sum the last 52 values out of 104??

  1. #1
    Registered User
    Join Date
    06-14-2020
    Location
    Fareham
    MS-Off Ver
    2013
    Posts
    2

    Sum the last 52 values out of 104??

    Evening All

    I am trying to capture information around hours worked.

    I have 104 columns of data (weeks numbered 1-104).

    All Rows have numerous zeros as well as a range of figures (some weeks worked, others not).

    Some Rows have less than 52 values that are greater than zero, others have more than 52.

    On each Row, I need to know the Sum the most recent <52 values that are greater than Zero - is this possible?

    Many Thanks

    Jax

  2. #2
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Sum the last 52 values out of 104??

    Hi,
    Since you didnt upload a sample file I made a simulation with 10 variables instead of 52

    The formula in D5 sums up all 9 variables that are not equal to zero.
    please find attached.

    =SUM(OFFSET(A3,,,,AGGREGATE(15,6,((1/(A3:S3<>0))*COLUMN(A3:S3)),10)-1))
    Attached Files Attached Files

  3. #3
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Sum the last 52 values out of 104??

    If you want the most recent 52 non-0, right-to-left, then:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-14-2020
    Location
    Fareham
    MS-Off Ver
    2013
    Posts
    2

    Re: Sum the last 52 values out of 104??

    XLent you are an absolute genius! Thank you so so much!

  5. #5
    Registered User
    Join Date
    03-26-2015
    Location
    Sofia, Bulgaria
    MS-Off Ver
    2019
    Posts
    8

    Re: Sum the last 52 values out of 104??

    I am just writing to express my appreciation for the use of N() and how the inclusion of the + sign makes the difference :D
    --
    TG|ЕS

+ 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] VBA Code replace old values to new values depends upon column values
    By johnlara in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-09-2015, 08:19 AM
  2. [SOLVED] VBA code to look up a list of values based on entered values and return all values.
    By dnwadams in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-30-2015, 10:14 PM
  3. [SOLVED] Extract values (row values and column values) with formula
    By bjnockle in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 08-17-2014, 10:13 AM
  4. [SOLVED] vba to Replace Old values by new values depends upon cell values in AC:AC col
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-25-2014, 08:15 AM
  5. Replies: 0
    Last Post: 10-12-2012, 01:08 PM
  6. [SOLVED] How to lookup values same row values different column values
    By kgonzalbo in forum Excel General
    Replies: 5
    Last Post: 05-22-2011, 01:49 AM
  7. assigning date entries to week values and month values to sum column C-N values C-
    By the accountant in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-20-2010, 09:52 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