+ Reply to Thread
Results 1 to 12 of 12

Moving and pausing a reference cell along with an IF function

  1. #1
    Registered User
    Join Date
    12-12-2019
    Location
    Japan
    MS-Off Ver
    Pro Plus 2010
    Posts
    23

    Moving and pausing a reference cell along with an IF function

    I'm trying to work out how a cell in a function should move down the column in line with the function, but then not advance once a condition has been triggered.

    In this example, my function initially references A1. This cell will of course change to a2, a3 etc automatically as the function is copied down the column. Once the condition for the function is met, I'd like all subsequent rows to reference the original cell until the condition breaks, then jump down to the next instance of a match.

    My function so far (column E) is

    =IF(D1>C1,(((B1-A1)*100)*12))

    This is fine for the first row which meets the criteria, but in this example, I'd like both B4 and B5 to reference A4 (B4-A4 & B5-A4), similarly E8, E9 & E10 should use A8 to subtract from B8-B10. I'm trying to calculate the figures in column E and am interested in the sum of B minus the cell in row A which first meets my condition.

    A B C D E
    1 0.99800 0.99934 30 16
    2 0.99885 0.99945 20 14
    3 0.99567 0.99933 25 17
    4 0.99456 0.99744 20 22 3.456
    5 0.99377 0.99555 22 25 1.188
    6 0.99467 0.99542 30 28
    7 0.99433 0.99560 40 35
    8 0.99465 0.99684 31 32 2.628
    9 0.99345 0.99554 30 36 1.068
    10 0.99445 0.99500 24 25
    11 0.99677 0.99673 30 29

    Would really appreciate any pointers for what direction I should be concentrating on to try and solve this.

    Many thanks,

    Gareth

  2. #2
    Forum Contributor
    Join Date
    11-10-2017
    Location
    INDIA
    MS-Off Ver
    365
    Posts
    184

    Re: Moving and pausing a reference cell along with an IF function

    HI Gareth,

    Can you include a sample file, refer the yellow banner above "HOW TO ATTACH YOUR SAMPLE WORKBOOK"

    Also, your formula does not help me actually what you are looking for, so include the col with desired result and elaborate bit more.
    Last edited by AliGW; 01-27-2020 at 08:48 AM. Reason: Colour formatting removed for better legibility.
    *If you wish you click on *,a way to say ThankYou

  3. #3
    Registered User
    Join Date
    12-12-2019
    Location
    Japan
    MS-Off Ver
    Pro Plus 2010
    Posts
    23

    Re: Moving and pausing a reference cell along with an IF function

    Sorry my explanation wasn't clear, here is a sample workbook.

    The formula and desired results are column E in my original example (calculated manually). Instead of calculating B-A row by row, I want to calculate B minus only the A value from the row when the condition was met. After the condition stops being met, I'd like things to repeat the next time it matches.
    Attached Files Attached Files

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Moving and pausing a reference cell along with an IF function

    Please add a column with manually calculated expected results.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    12-12-2019
    Location
    Japan
    MS-Off Ver
    Pro Plus 2010
    Posts
    23

    Re: Moving and pausing a reference cell along with an IF function

    AliGW,

    My manually calculated expected results are column E in the original example, column J in the excel file.

    Thanks,

    Gareth

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Moving and pausing a reference cell along with an IF function

    Sorry - column J contains a formula - that is not manually calculated.

  7. #7
    Registered User
    Join Date
    12-12-2019
    Location
    Japan
    MS-Off Ver
    Pro Plus 2010
    Posts
    23

    Re: Moving and pausing a reference cell along with an IF function

    My mistake, I've added column K with manually calculated expected results.

    Thanks,

    Gareth
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    11-10-2017
    Location
    INDIA
    MS-Off Ver
    365
    Posts
    184

    Re: Moving and pausing a reference cell along with an IF function

    Hi Gareth,

    Need add a new col and calculate the correct and correctly against "Criteria met, currently incorrect"

    For "Currently being used, I want them to be ignored
    "Currently being used, I want them to be ignored" what you want in place of that , either col J should display a value or it should be blank???

    The cell I want the function to use = Where I mean the applicable cells that you are looking forward to
    Used for the first part of the sum= first part of sum of col J, explain the logic to get it achieved???

  9. #9
    Registered User
    Join Date
    12-12-2019
    Location
    Japan
    MS-Off Ver
    Pro Plus 2010
    Posts
    23

    Re: Moving and pausing a reference cell along with an IF function

    Thanks for your reply. Sorry I seem to be doing a terrible job of explaining what I'm trying to achieve.

    At its most basic, I want to subtract C from D, but when I copy the formula down, I want to subtract each row in D from one cell in column C. Normally this is no issue but since throughout my data this happens several times, each time with a different static cell in C, I'm stuck with how to complete the formula.

    For 'currently being used, I want them to be ignored', I want only the green cells to be used. So J2 contains D2-C2, J3 contains D3-C2, C never changes until the next time my conditional formula triggers.

    Gareth

  10. #10
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: Moving and pausing a reference cell along with an IF function

    Try this array function
    =IF(I2>G2,(((D2-IFERROR(LOOKUP(2,1/($I$1:I1<=$G$1:G1),$C$2:C2),INDEX(C:C,MATCH(1,INDEX(--($I$2:I2>$G$2:G2),),)+1)))*100)*12)),
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    11-10-2017
    Location
    INDIA
    MS-Off Ver
    365
    Posts
    184

    Re: Moving and pausing a reference cell along with an IF function

    Quote Originally Posted by garethlittle View Post
    My mistake, I've added column K with manually calculated expected results.

    Thanks,

    Gareth
    Dear, Just explain what your logic behind it/ want, do not worry how will I achieve it.

  12. #12
    Registered User
    Join Date
    12-12-2019
    Location
    Japan
    MS-Off Ver
    Pro Plus 2010
    Posts
    23

    Re: Moving and pausing a reference cell along with an IF function

    BMV,

    That works perfectly! Thanks so much for taking the time to look at it.

    Thanks to all for your help, I'd have never worked it out on my own!

    Gareth

+ 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] Moving a cell on a worksheet does not move reference in VBA
    By JimDandy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-09-2016, 04:29 PM
  2. moving a cell reference down one row automatically
    By tmillerbkpr in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-17-2014, 04:03 PM
  3. Reference a moving cell in another table
    By Carson Dyle in forum Excel General
    Replies: 4
    Last Post: 05-31-2013, 01:29 AM
  4. Pausing macro until .xla function completes
    By rtylerdunn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-16-2007, 05:57 PM
  5. Moving left of a cell reference
    By jagbabbra in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-13-2006, 09:15 AM
  6. Moving left of a cell reference
    By jagbabbra in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-13-2006, 09:01 AM
  7. [SOLVED] Moving Cell Reference after Sorting
    By [email protected] in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 03-11-2006, 07:15 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