+ Reply to Thread
Results 1 to 7 of 7

Updating a value to alter all other values used in a fix sum

  1. #1
    Registered User
    Join Date
    12-05-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Updating a value to alter all other values used in a fix sum

    Hi All

    Apologies for the clunky title. I will try to explain more clearly.

    I have a scenario where the total amount I can spend is 100. This is current distributed equally over 4 weeks 25,25,25,25.

    I want to change one of the weeks to 40 and then have the rest of the weeks alter in proportion so that the total stays at 100 i.e. (100/40)/3 = 20

    I can do this if I know which week I am changing and I have attached this as an example, however I cant see how I would create a formula that allowed me to change any week and have the other three weeks alter.

    I have a few more advanced questions but hopefully someone can point me in the right direction to start me off!

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Updating a value to alter all other values used in a fix sum

    Hello cplib,

    Maybe something along the lines of the attached sample Workbook?

    Regards.
    Attached Files Attached Files
    Last edited by Winon; 01-15-2014 at 02:07 PM. Reason: Pressed the wrong button, without an attachment.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Updating a value to alter all other values used in a fix sum

    Hi,

    Since a cell can be either a manually entered value or a formula you'll need a Sheet Change macro. i.e.
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    12-05-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Updating a value to alter all other values used in a fix sum

    Hi Winon

    Thanks for your reply. This method doesn't let me alter B2,C2, or D2 and have the change reflect in the other three values.

    Thanks

    Craig

  5. #5
    Registered User
    Join Date
    12-05-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Updating a value to alter all other values used in a fix sum

    Hi Richard Buttery

    I inserted this into a VB module and I can see that when altering one of the values in A:D if then updates the other three. However what doesn't happen is that it doesn't constrain the total to be 100. e.g. should I alter the value of A2 to 40 then B,C and D should be 20, if alter if to 55 then they should alter to 15.

    Is there a way that this can be achieved?

    Thanks for all your help.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Updating a value to alter all other values used in a fix sum

    Hi,

    First of all it shouldn't be in a VB Module. That's why I explicitly mentioned it needs to be a Sheet Change event. Also see the procedure name.

    It will distribute the non manually entered cells so that the overall total of the 4 cells equals the column E cell. You do not need to enter a formula in column E, just the value that you want the cells to total to.

    See attached.
    Attached Files Attached Files

  7. #7
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Updating a value to alter all other values used in a fix sum

    Hello cplib,

    Thank you for the feedback.

    Richard Buttrey has given you a good start. I have tweaked his Code a little bit, (Sure he won't mind ).

    Please see if the attached sample Workbook, is now closer to what you are looking for.
    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. List box values updating but text is not updating
    By Shane of the Newbs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-16-2011, 11:53 AM
  2. Alter numeric values by size
    By lengjay in forum Excel General
    Replies: 4
    Last Post: 11-12-2009, 10:34 PM
  3. Macro to file values & formats, & alter protection
    By Benb in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-30-2008, 08:56 AM
  4. Alter value in one cell alter value in multiple cells
    By Bryan Noqw in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 03-11-2008, 05:31 AM
  5. How to alter values shown in Excel
    By jbricher in forum Excel General
    Replies: 5
    Last Post: 12-11-2007, 04:35 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