+ Reply to Thread
Results 1 to 3 of 3

Summing a variable number of cells and parts of cells

  1. #1
    Registered User
    Join Date
    03-18-2014
    Location
    Manchester, UK
    MS-Off Ver
    Excel 2013
    Posts
    2

    Summing a variable number of cells and parts of cells

    Hi, in my financial modelling I often have a calculated number of months of inventory. This number varies. I need to use this number to calculate the actual inventory value. For eg. it may be 3.2 months of inventory; in this case I need to sum 3 cells (current month, current month -1, current month -2) plus 0.2 of the fourth cell (current month -3)

    But I may need to change the number of months of inventory to, for example, 4.2. In this case I would need the sum of four cells plus 0.2 of the fifth cell etc etc

    Hoping I can get some advice for suitable formula that will handle the above. Thanks in advance

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,701

    Re: Summing a variable number of cells and parts of cells

    Hi,

    Let's assume that your current month is in J2, previous months in previous columns (I2, H2, ...) and the moinventory is in K2.
    use the following formula in M2 (or other place where you want your "special sum"):

    =SUM(OFFSET(J2,0,1-ROUNDDOWN(K2,0),1,ROUNDDOWN(K2,0)))+OFFSET(J2,0,-ROUNDDOWN(K2,0))*MOD(K2,1)

    this formula sums from rounded down K2 (3 or 4 in your examples) cells preceeding (and including) J2 and adds the one one more to the left multiplied by decimal part of K2.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    03-18-2014
    Location
    Manchester, UK
    MS-Off Ver
    Excel 2013
    Posts
    2

    Re: Summing a variable number of cells and parts of cells

    @Kaper thanks so much. It works perfectly

+ 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] Summing a variable number of cells
    By Bezzie in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 03-09-2014, 03:18 PM
  2. Summing a variable number of cells
    By rschammel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-30-2013, 02:55 AM
  3. [SOLVED] Need help with summing a variable number of cells
    By loolala in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 07-02-2013, 07:56 PM
  4. Summing a variable number of cells
    By lovi in forum Excel General
    Replies: 3
    Last Post: 09-06-2011, 07:55 PM
  5. summing cells from a variable number of rows
    By Onesimus Prime in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-01-2008, 02:10 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