+ Reply to Thread
Results 1 to 4 of 4

show % change with input variable for # of rows ahead

  1. #1
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Key West, FL
    MS-Off Ver
    365 Apps for Enterprise
    Posts
    665

    show % change with input variable for # of rows ahead

    I've attached a worksheet showing two columns of numbers, and in column C, the % difference between the current row, and 3 rows back (earlier in time).

    I'd like cell E3 to be an input, in which the # of rows back can be changed.

    So for example, if we use "1" as the input for E3, then the first value shown would be in cell C5, and the number would be -.59%

    I assume we use the ADDRESS function here? Or Offset?

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: show % change with input variable for # of rows ahead

    Put this formula in cell C5:

    =IF(ROWS($1:1)<$E$3,"",B5/INDEX(B:B,ROWS($1:1)-$E$3+4)-1)

    then copy down as required.

    Hope this helps.

    Pete

  3. #3
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Key West, FL
    MS-Off Ver
    365 Apps for Enterprise
    Posts
    665

    Re: show % change with input variable for # of rows ahead

    Thanks Pete.

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: show % change with input variable for # of rows ahead

    You're welcome - thanks for the rep.

    Pete

+ 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. Variable calculated rows based on input fields
    By rxberry1530 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-21-2016, 03:31 PM
  2. hide/show variable number of rows
    By ctalley5 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-27-2016, 03:16 AM
  3. [SOLVED] Inserting multiple rows depending on variable input
    By nosense in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-17-2015, 08:24 AM
  4. Replies: 6
    Last Post: 09-06-2014, 10:50 AM
  5. Selecting Columns and rows via variable input
    By AlistairB in forum Excel General
    Replies: 3
    Last Post: 12-02-2012, 07:20 PM
  6. change the number of rows to a variable
    By minrufeng in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-15-2005, 05:03 PM
  7. H2 get excel to return 6 months ahead ie input jan and it returns
    By Xeraco in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-25-2005, 11:06 PM

Tags for this Thread

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