+ Reply to Thread
Results 1 to 12 of 12

Calculating values based on other inputs.

  1. #1
    Registered User
    Join Date
    11-07-2013
    Location
    Ireland
    MS-Off Ver
    Excel 2010
    Posts
    21

    Calculating values based on other inputs.

    So, I know that this is about as basic as it gets but I could use some help. I'm creating a worksheet which allows the user to input a number of different values. Within this larger group of inputs, there exists 4 inputs which only require 2 to be known to know the remaining 2. These 4 inputs are R, CP, CV and Gamma. Given by:
    R = CP - CV (1)
    Gamma = CP/CV(2)
    CV = R/Gamma - 1 (3)
    CP = R + CV (4)

    As you can see, if any two of the above are know, the other 2 can be calculated. I've tried the following
    Column A _______Column B
    R ____________= CP - CV
    Gamma________= CP/CV
    CV___________ = R/Gamma - 1
    CP____________ = R + CV

    This throws up a problem though. It says I've created a 'circular' reference and then when I input values for, let's sat, Gamma and CP, the remaining 2 aren't calculated. How do I fix this so that when I input any 2, the remaining 2 are calculated? Thanks.(Note, I've named the cells corresponding to CP, CV, R and Gamma)
    Last edited by Dapos1993; 11-07-2013 at 04:55 PM. Reason: Easier to visualise.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Calculating values based on other inputs.

    I would use a macro for this.

    This would see if you change any two of these inputs and change the remaining two.


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mehmetcik; 11-07-2013 at 05:30 PM.

  3. #3
    Registered User
    Join Date
    11-07-2013
    Location
    Ireland
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Calculating values based on other inputs.

    Apologies for being slow to catch on, but what exactly is a macro and more importantly how would I go about implementing one? Thanks for the reply.

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Calculating values based on other inputs.

    Hi

    I have written the macro for you.

    The sample is attached.

    Enter a value into any two of the cells and see what happens.

    To see the code right click on the sheet name at the bottom of excel and select view code.

  5. #5
    Registered User
    Join Date
    11-07-2013
    Location
    Ireland
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Calculating values based on other inputs.

    Sorry, didn't see the attachment at first as I was viewing the site on phone. Just downloaded it there and entered values into 2 cells but the other 2 just remained blank. Is there anything else I need to do after downloading it and opening the file? Thanks.

  6. #6
    Registered User
    Join Date
    11-07-2013
    Location
    Ireland
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Calculating values based on other inputs.

    Also, the code isn't actually showing up once I click 'view code'. Also, is there any way of doing this without a macro?

  7. #7
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Calculating values based on other inputs.

    you need to enable macros

    It might ask you to enable content

  8. #8
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Calculating values based on other inputs.

    This is quite a complex problem, you will probably always end up with circular references

    My Apologies i attached the wrong version
    Attached Files Attached Files
    Last edited by mehmetcik; 11-07-2013 at 06:33 PM.

  9. #9
    Registered User
    Join Date
    11-07-2013
    Location
    Ireland
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Calculating values based on other inputs.

    I enabled editing and went into options, trust centre settings, macro settings and then enabled all macros. Still, nothing though. Have enabled them correctly?

  10. #10
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Calculating values based on other inputs.

    Have you loaded the file Gamma.XLSM?

  11. #11
    Registered User
    Join Date
    11-07-2013
    Location
    Ireland
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Calculating values based on other inputs.

    Just got it going there. Thanks! Although, it's only possible to change the values of R and Cp. Cv and Gamma actually stay fixed, which is essentially the initial problem.

  12. #12
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Calculating values based on other inputs.

    hi

    you need to clear all 4 values at once.

    remember the macro runs if the first two cells have values in them. So it looks like the last two cells are fixed

    This version clears a couple of bugs.
    Attached Files Attached Files
    Last edited by mehmetcik; 11-07-2013 at 08:10 PM.

+ 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] Calculating MTD values based upon today-1
    By Dennis.Neeld in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-29-2012, 10:49 AM
  2. calculating values based on colour criteria
    By yolbut in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-25-2012, 09:37 AM
  3. [SOLVED] macro which copies all column values based on specific string inputs
    By buntalan80 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-12-2012, 03:08 PM
  4. Calculating Values based on a range or 2...
    By tmwsccsh in forum Excel General
    Replies: 2
    Last Post: 03-01-2011, 05:14 PM
  5. Calculating min/max of set of values based on day change
    By this_barb in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 07-06-2010, 03:21 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