+ Reply to Thread
Results 1 to 5 of 5

Creating a Dynamic Chart Based on Variables

  1. #1
    Registered User
    Join Date
    03-08-2012
    Location
    US, Florida
    MS-Off Ver
    Excel 2003
    Posts
    6

    Creating a Dynamic Chart Based on Variables

    I know there must be some information out there, I have no idea what this is called. I tried several searches on here and on Google.

    I have a structural calculation and I am trying to determine the most efficient shape of a foundation. So width (W) by depth (D). My calculation outputs safety factors (SF) when I change the width and depth and results with areas (A) which helps me get my efficiency. I am plotting these one by one as I change them, but how could I (or what is this called) to create a chart automatically based on changing these 2 variables with certain parameters.

    For example:
    Change W within values 2 to 4 with 0.25 intervals (2, 2.25, 2.5, 2.75,etc...)
    Change D within values 1 to 2 with 0.25 intervals (1, 1.25, 1.5, etc...)
    Desired SF range 2 - 2.5

    Chart Output:
    Width W | Depth D | Safety Factor SF | Area A
    Sort SF from greatest to smallest, AND sort A from smallest to greatest

    How do I do this? Or what is this called so I can find some tutorials.

    Thanks!

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Creating a Dynamic Chart Based on Variables

    I don't understand exactly what you are trying to do. Based on what I understand, here's how I would probably begin setting this up:

    1) In A1 enter "W", B1 -- "D", C1 -- "SF", D1 -- "A"
    2) In A2, enter the starting value for W (2), in B2, enter the starting value for D (1). In C2, enter the desired formula for SF, and the desired formula for A into D2. Pay attention to absolute and relative references so you can just copy these cells down.
    3) In A3, enter =A2+0.25. B3 -- =B2.
    4) Copy A3:B3 and paste down until W is 4 (A10:B10?)
    5) In A11 (or whatever is right beneath the max value of W), enter a new formula =A2. In B11, enter =B2+0.25.
    6) Copy A11:B11 and paste down until you have the complete matrix of W and D values.
    7) Copy C2:D2 and fill in the SF and A columns.
    8) The sort operation may work just fine at this point, but I would probably copy columns A and B and paste as values to avoid any problems caused by the sort.
    9) Select the table of values and sort by the SF column, then by the A column.

    That's how I would do this. Am I understanding correctly? Where do you get stuck?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    03-08-2012
    Location
    US, Florida
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Creating a Dynamic Chart Based on Variables

    Thanks for the response.

    Yes I would normally do that for a simple formula. But SF is calculated via an entire page of calculations including W and D as variables. When I change W and/or D I get different results. I created a separate sheet and made the chart and manually changed the W and D and tabulated a list of results. As you may of guessed this was time consuming and I did not explore every option for that reason. I am fairly certain there must be a way to automatically do this, I have no idea what this would be called and therefore am having difficulty searching the topic.

    Thanks again!

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Creating a Dynamic Chart Based on Variables

    A few options:

    1) Easiest is probably to use a 2D data table. The output won't be in the nice list format that you describe in the OP, however. The output of a 2D data table will have the W values down the left side of the output, D across the top of the output, and the SF values in the body of the table. But it should be a very quick and easy way to compute SF at multiple different W and D input values. This kind of format will not lend itself well to sorting. Some simple lookup functions could be used to convert the 2D data table output to the list output you wanted.
    https://support.office.com/en-us/art...2-77542a5ea50b
    https://www.excel-easy.com/examples/data-tables.html

    2) Rearrange your SF sequence of calculations so that it fits into a single row. This row then gets appended to the right of the desired output table and the final SF result ends up in column C as currently demonstrated. These helper columns can be hidden, if you tire of looking at them.
    Please Login or Register  to view this content.
    3) If this SF calculation is one that you will use frequently in many different spreadsheets, I would be tempted to write a VBA user-defined function (UDF) to perform the sequence of SF calculations. My introduction to UDFs: https://www.excelforum.com/tips-and-...uild-udfs.html

  5. #5
    Registered User
    Join Date
    03-08-2012
    Location
    US, Florida
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Creating a Dynamic Chart Based on Variables

    Thank you, I did the data table and that worked. I copied over the table and made an area table separately.

+ 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. Problems creating a bar or column chart based on dynamic offset ranges
    By chrisk67 in forum Excel Charting & Pivots
    Replies: 10
    Last Post: 09-01-2016, 03:23 PM
  2. [SOLVED] Creating Dynamic Range using Variables in VBA creates Runtime 1004 Error
    By DrEcosse in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-11-2015, 10:09 AM
  3. Creating dynamic userform based on several file names and creating chart overlays
    By Thorn23 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-18-2014, 12:09 PM
  4. Creating automatic/dynamic drop down lists from a table with multiple variables
    By bobby.bobby in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-09-2013, 09:55 AM
  5. Creating Variables for mutiple dynamic files
    By jasonfish11 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-18-2012, 12:21 PM
  6. Replies: 7
    Last Post: 11-24-2010, 05:35 AM
  7. Creating chart w/ formula based dynamic axes
    By mmorri4 in forum Excel General
    Replies: 3
    Last Post: 05-25-2010, 11:37 AM

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