+ Reply to Thread
Results 1 to 7 of 7

Increase a cell value until another cell value is matched

  1. #1
    Registered User
    Join Date
    09-18-2011
    Location
    Dublin
    MS-Off Ver
    Excel 2010
    Posts
    6

    Increase a cell value until another cell value is matched

    HI,

    I am looking to increase a single cell value from 0 up to 1000 automatically. This cell is linked to a formula that changes another cell. When this other cell hits a certain value i wish the first cell to stop and show me the figure.

    So for example:

    A1 - This is my cell that will start at 0 value
    A2 - Has a static value in it - example - 2500
    A3 - This cell always starts at 1000 and increases when A1 is increased.

    We start to increase cell A1 by multiples of 50 and then this increase A3 at a set rate. When the A3 value matches the A2 static value (2500) then the calculation is completed and i can use the value in A1.

    Is their a way to write a macro (or formula) to automatically increase A1 until A3 matches A2.

    Any help on this would be much appreciated.

    Simon,

  2. #2
    Forum Contributor shank_mis's Avatar
    Join Date
    09-08-2018
    Location
    Delhi
    MS-Off Ver
    2010
    Posts
    128

    Re: Increase a cell value until another cell value is matched

    What is the formula in A3 ?
    Without knowing the formula it is very difficult to provide a proper solution.
    Example: If A3=1000+A1, and A2=1500

    =SMALL(IF(ROW(INDIRECT("1:1000"))+1000=A2,ROW(INDIRECT("1:1000"))),1)
    Confirm with Ctrl+Shift+Enter

    ROW(INDIRECT("1:1000")) will generate numbers from 1 to 1000.
    This formula will return 500 which is the value of A1.
    Focus on BOLD part.... that's the formula in A3...I mean how it is connected to A1.
    Last edited by shank_mis; 02-18-2020 at 12:11 AM.
    Shashank Mishra
    Please hit "Add Reputation" Button if you liked the answer.

  3. #3
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Increase a cell value until another cell value is matched

    Do you mean
    A1
    =(A2-A3)*50 ?

    Regards.

  4. #4
    Registered User
    Join Date
    09-18-2011
    Location
    Dublin
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Increase a cell value until another cell value is matched

    HI,

    Sorry for the bad explanation above. I have attached the file which should make it so much easier.

    basically just adjust B12 until B10 and B11 match each other. The value for the example is 2980 needs to go into B12.

    Appreciate any help on this as i will have lots of these sheets where i need to enter in a number into B12 until B10 and B11 MATCH.
    Attached Files Attached Files

  5. #5
    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: Increase a cell value until another cell value is matched

    You can't do this with a regular formula. You will need to look at Goalseek, Solver or a VBA routine.
    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.

  6. #6
    Registered User
    Join Date
    09-18-2011
    Location
    Dublin
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Increase a cell value until another cell value is matched

    VBA routine is the best approach i think, i would be happy to use that.

  7. #7
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Increase a cell value until another cell value is matched

    I've set up a solver model based on your uploaded file. Solver if installed is found in the "Data" tab. The setup in this case is quite simple.

    Solver only need to be told what cell to change i.e. B12 and that the constraint is that B10 = B11 and then click "Solve"

    Alf
    Attached Files Attached Files

+ 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. Replies: 5
    Last Post: 01-06-2015, 10:11 AM
  2. [SOLVED] incremental increase in a cell based on value increase in another cell
    By umuni in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-18-2014, 05:23 AM
  3. Formula to Replace Portion of Cell that Contains Matched Text to Cell
    By celestealexandra in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-22-2014, 03:56 PM
  4. Replies: 11
    Last Post: 03-27-2014, 07:55 PM
  5. If cell middle parts are matched ,that cell highlight
    By johncena in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-14-2012, 03:48 AM
  6. Replies: 2
    Last Post: 06-29-2012, 07:02 AM
  7. Copy/Paste Values to the Cell Next to a Matched Cell
    By Mungchungg in forum Excel General
    Replies: 6
    Last Post: 01-23-2012, 04:08 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