+ Reply to Thread
Results 1 to 7 of 7

What-If Scenario

  1. #1
    Registered User
    Join Date
    04-24-2017
    Location
    The Netherlands
    MS-Off Ver
    2016
    Posts
    6

    What-If Scenario

    All,

    Been trying to find answers via Google but no luck so far.

    I'll try to keep a complex case very simple by coming up with a generic example. In my Workbook X, Sheet 1 is a form with 4 input cells: A1 to A4, and 8 output cells: B1 to B8. The calculations to populate the output fields based on the input fields take place in Sheet 2 to Sheet 5 using a multitude of formulas and look-up tables. For every calculation, all four input cells (A1 to A4) have to be filled and all eight output cells (B1 to B8) will give a result.

    In an entirely new Sheet I would like to make a simple table which will eventually contain about 1,000 records. Each record is a result of the calculation in Sheet 1. Columns A to D in my new table will be the input for cells A1 to A4 in Sheet 1. Columns E to L should give the output of cells B1 to B8 in Sheet 1.

    Seeing as I am working towards 1,000 records I want to automate this instead of manually copy pasting the 8 output cells in a record. How do I pull this off? For multiple reasons (the complexity being one) it is currently impossible to incorporate the logic that populates Sheet 1 B1 to B8 in every potential record in the new results table.

  2. #2
    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: What-If Scenario

    Hi,

    The way I'd approach it is to create a named range of 12 cells on the same row.

    Then all you need is a single line macro along the lines of

    Please Login or Register  to view this content.
    Now all you need to do is identify something that will trigger the macro. Perhaps a button which you click, or maybe a SheetChange event macro that first checks to see if a new record is ready to be added.

    Incidentally would you change your location to something meaningful please. Most of us do inhabit Earth so it tells us nothing and knowing your location is sometimes helpful when we may need to consider time zones or regional settings for dates, list separator characters and other stuff
    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.

  3. #3
    Registered User
    Join Date
    04-24-2017
    Location
    The Netherlands
    MS-Off Ver
    2016
    Posts
    6

    Re: What-If Scenario

    I'm sorry, didn't know the Location field served that purpose. Updated accordingly.

    Thanks for your suggestion, I'm going to take a look at it.

  4. #4
    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: What-If Scenario

    Quote Originally Posted by ORWS View Post
    I'm sorry, didn't know the Location field served that purpose. Updated accordingly.
    Thanks.

  5. #5
    Registered User
    Join Date
    04-24-2017
    Location
    The Netherlands
    MS-Off Ver
    2016
    Posts
    6

    Re: What-If Scenario

    Been messing around with what you've said but I think I did not make myself clear..

    My aim is to populate the 4 input fields in those 1,000 records manually and have the calculation populate the 8 output fields.

  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: What-If Scenario

    If I've misinterpreted your data/requirement I still think the technique I mentioned or a small modification will be able to be used.

    However upload your workbook, or at least a representative subset of it, and manually add some results. Clearly explain what data you started with and which cells contain the results.

  7. #7
    Registered User
    Join Date
    04-24-2017
    Location
    The Netherlands
    MS-Off Ver
    2016
    Posts
    6

    Re: What-If Scenario

    Unfortunately I cannot share (a part of) the actual Workbook due to its content so I've made a very simplistic representation of the issue I'm facing.

    Sheet1 FORM:
    The white cells are the input fields, the grey cells give the output based on calculations done in Sheet 2 FORMULAS.

    Sheet 3 RESULTS:
    By populating the 4 input columns myself, I'd like Excel/a script to automatically input those 4 input variables in the calculation on Sheet 1 FORM and subsequently copy the 8 output variables of Sheet 1 FORM into the 8 output columns of the table on Sheet 3 RESULTS.

    Perhaps the biggest restriction is that I cannot change anything on Sheet 1 FORM and Sheet 2 FORMULAS, except for the input fields on Sheet 1 FORM, I can have a formula or script populate those fields instead of populating them manually. So to put it simple, I need something to:

    - read the 4 input variables off a record in Sheet 3 RESULTS
    - paste them in the 4 input fields in Sheet 1 FORM
    - read the 8 output variables off Sheet 1 FORM
    - paste them in the 8 output fields in Sheet 3 RESULTS
    - repeat the above for all records in Sheet 3 RESULTS that I provide 4 input values for
    Attached Files Attached Files
    Last edited by ORWS; 04-24-2017 at 08:44 AM.

+ 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. VBA - If/Then scenario
    By ggentry in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-15-2014, 10:06 AM
  2. Scenario Manager displays same result for every scenario
    By terihoff in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 11-10-2012, 07:14 PM
  3. Replies: 0
    Last Post: 08-16-2012, 01:32 PM
  4. Not able to Add a Scenario
    By Harshit Kohli in forum Excel General
    Replies: 0
    Last Post: 08-15-2012, 02:43 PM
  5. IF, THEN scenario (I think) help, please... Thanks!
    By Micherie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-10-2012, 05:45 PM
  6. Help with scenario
    By Spud1129 in forum Excel General
    Replies: 3
    Last Post: 04-30-2012, 01:38 PM
  7. Scenario
    By punkiegirl420 in forum Excel General
    Replies: 5
    Last Post: 11-05-2006, 05:26 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