+ Reply to Thread
Results 1 to 5 of 5

how to create a trailing fixed range

Hybrid View

  1. #1
    Registered User
    Join Date
    07-25-2013
    Location
    United Kingsdom
    MS-Off Ver
    Excel 2007
    Posts
    3

    how to create a trailing fixed range

    Im no excel pro...and Ive learned more struggling with this problem in the last few days than I was bothered to learn before...but this is bugging me

    simply put (and its not as simple as described below)........

    say we have three cells at ...C3,D3,E3

    C3 = 1, D3 = 2 and E3 is where I want the result....so I run a SUM function to for result to appear in E3....easy! 1+2=3

    Then I insert a new column to the left of column E....resulting in cell E3 moving to F3.....I copy column D and paste into column E ....the appearance now changes to sum of three cells C3=1...+D3=2...+E3=2...result in F3 SUM=5

    my problem is I don't want that.....

    I want the F3 result cell to show the sum of data from cells D3=2 and E3=2...I don't want SUM to include cell C3 in the calculation...I only want the two cells before the result cell

    but I also don't want to have to rerun a new Sum function every time I add a column or to trim or slide the formula manually

    basically the job is to run rolling AVERAGE and SUM functions where the historic data trails the result cell by a fixed amount 3 months/3 cells....12 months/12 cells

    all help very appreciated.....its been fun trying to work it out but what ever I have done does not seem to work

    there are several other formulas running in each column for different requirement....these copy and past from the previous month to the new month and the formulas follow the change in position....SUM and AVERAGE stay anchored to the left most cell like a tape measure pinned at one end
    Last edited by xxxscimitarxxx; 07-25-2013 at 01:39 PM.

  2. #2
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: how to create a trailing fixed range

    In your description, try this instead of the SUM() function - type this into E3

    =SUM(OFFSET(E3,0,-1),OFFSET(E3,0,-2))

    That will do what you are describing, the E3 will become F3 after the insert, but the -1 and -2 (column offsets) will not change. The rightmost column will sum the other two.
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    07-25-2013
    Location
    United Kingsdom
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: how to create a trailing fixed range

    will give that crack in the morning ....thanks a bundle

  4. #4
    Registered User
    Join Date
    07-25-2013
    Location
    United Kingsdom
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: how to create a trailing fixed range

    I couldn't wait so I ran it on my example......perfect!.....been struggling with that for four days....cant thank you enough

    I had all sorts of so called pros at my works giving me a sharp intake of breath and telling me its macro time....

  5. #5
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: how to create a trailing fixed range

    Glad to be of help

+ 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. Concatenate and create fixed length
    By Linda12765 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-03-2013, 09:55 AM
  2. excel 2007 macro need to have variable range of rows rather than fixed range
    By JW1028 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-20-2013, 02:45 PM
  3. Change range of cells within VBA macro and copy and paste to fixed cell range
    By Mannyny in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-20-2012, 11:51 AM
  4. how to create a range with fixed columns and changing rows
    By shettyp in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 01-19-2012, 02:52 AM
  5. VBA to add leading o's and trailing space for fixed length SIR fields
    By Zyphon in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-03-2008, 08:51 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