+ Reply to Thread
Results 1 to 25 of 25

Formula to reference an multiple cells to one cell.

  1. #1
    Registered User
    Join Date
    12-07-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    13

    Formula to reference an multiple cells to one cell.

    Hi, I'm hoping someone can help out with my problem. What I'm trying to do is link my Seed Value from the Gamma Analysis and Log Normal Analysis to my LCG Calculator, however I'm only able to reference one of the spreadsheets leading me to "='Gamma Analysis'!B7". I'm looking for a way such that when one of the sheets are active the LCG Calculator takes the value from the active spreadsheet. Thank you in Advance!
    Attached Images Attached Images
    Last edited by RizzlaXD; 12-07-2014 at 02:30 PM.

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Formula to reference an multiple cells to one cell.

    I havent got excel in front of me so cant test it but, cant you reference one of the sheets and if it returns an error then reference the other? Something like...
    Please Login or Register  to view this content.
    If someone has helped you then please add to their Reputation

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Formula to reference an multiple cells to one cell.

    Hi, welcome to the forum

    Please upload a sample of your workbook, not a picture of your data. Pictures are pretty much impossible to edit, and no-one wants to re-type your data for you
    Also, not all members can upload picture files (Company firewalls and stuff)

    Your workbook should show a small desensitized example of the data you are working with and a manual mockup of the expected results.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    12-07-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    13

    Re: Formula to reference an multiple cells to one cell.

    Thank you for your reply,
    The function doesn't seem to be working correctly as I tried a seed value of 150 in the Gamma Analysis but it didn't update in the LCG Calculator =l I've attached my Excel workbook so you can see where it's not updating. Thank you again! =)
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-07-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    13

    Re: Formula to reference an multiple cells to one cell.

    Thank you! ^^

    Yeah I figured it was a much better idea =P

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Formula to reference an multiple cells to one cell.

    Thanks for the file

    Im not really sure what you are trying to do here Can you walk me through what you are doing, and samples of what you expect?

  7. #7
    Registered User
    Join Date
    12-07-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    13

    Re: Formula to reference an multiple cells to one cell.

    For ease what I'm trying to do is 'link' the seed value from the Analysis spreadsheets (Gamma and Log-Normal) so that it updates in the LCG Calculator. The problem I have is that I can only link the Seed Value to one of the Analysis spreadsheet but not both, I only end up doing something like "='Gamma Analysis'!B7" which ignores Log Normal Analysis' Seed value from updating.

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Formula to reference an multiple cells to one cell.

    OK, and how do you decide which sheet to use? Could you put an indicator on LCG which shows the sheet to use?

  9. #9
    Registered User
    Join Date
    12-07-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    13

    Re: Formula to reference an multiple cells to one cell.

    Umm well the decision is up to the user, I just want it so that whichever Worksheet is currently in use, it takes the seed value from that and inputs it into LCG B5

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Formula to reference an multiple cells to one cell.

    But as soon as you select LCG, then that is teh active sheet, and not the sheet you just came from?

    Would it be practical to use a "switch" on the LCG sheet, so that whoever - can select which to use?

  11. #11
    Registered User
    Join Date
    12-07-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    13

    Re: Formula to reference an multiple cells to one cell.

    Oh no, The active sheets are going to be the Analysis sheets. The LCG Calculator is just used so that I can generate Pseudo-Random numbers which is used in the analysis Look at "Claim Amount" columns they're using "Random" which is the range of cells from LCG C7:C206.
    Last edited by RizzlaXD; 12-07-2014 at 06:55 PM.

  12. #12
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Formula to reference an multiple cells to one cell.

    So will there always only be one of the two workbooks open and you just want it to use the one that's open?

  13. #13
    Registered User
    Join Date
    12-07-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    13

    Re: Formula to reference an multiple cells to one cell.

    Quote Originally Posted by pjwhitfield View Post
    So will there always only be one of the two workbooks open and you just want it to use the one that's open?
    Yup! One of the worksheets will be active and I want that seed value to be inputted to LCG. Sorry if what I'm saying is confusing =)
    Last edited by RizzlaXD; 12-07-2014 at 07:16 PM.

  14. #14
    Registered User
    Join Date
    12-07-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    13

    Re: Formula to reference an multiple cells to one cell.

    So if I enter a value of 150 into the Seed Value input on Gamma Analysis, this will update the seed value on the LCG Calculator. So I want the same to happen with Seed Value input on Log Normal Analysis, e.g. I input Seed Value of 23 and this will update on the LCG Calculator

  15. #15
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Formula to reference an multiple cells to one cell.

    So, both sheets could have a seed in them, but you only want the 1 in the active sheet to be used?

  16. #16
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Formula to reference an multiple cells to one cell.

    OK, another thought...

    How about if you do all the calcs in each sheet? So instead of haveing that LCG sheet, each of the other 2 sheets have their "own" LCG data in that sheet

  17. #17
    Registered User
    Join Date
    12-07-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    13

    Re: Formula to reference an multiple cells to one cell.

    Quote Originally Posted by FDibbins View Post
    So, both sheets could have a seed in them, but you only want the 1 in the active sheet to be used?
    Yes please =)

  18. #18
    Registered User
    Join Date
    12-07-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    13

    Re: Formula to reference an multiple cells to one cell.

    Quote Originally Posted by FDibbins View Post
    OK, another thought...

    How about if you do all the calcs in each sheet? So instead of haveing that LCG sheet, each of the other 2 sheets have their "own" LCG data in that sheet
    I did that at first but then the workbook slowed down a lot =l

  19. #19
    Registered User
    Join Date
    12-07-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    13

    Re: Formula to reference an multiple cells to one cell.

    As you can see it works when I have 2 individual LCG Calculators, but I want to use just 1 LCG Calculator for both analyses
    Attached Files Attached Files

  20. #20
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Formula to reference an multiple cells to one cell.

    Then perhaps review what formulas you are using and see if they can be streamlined?

  21. #21
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Formula to reference an multiple cells to one cell.

    The only other way I can think to do this would be to review the list of Open work books to find which of the two was open and then use that to potentially amend the formulas in the book.

    eg Set the formulas up to use the ='Gamma Analysis'!B7 references and then in the Workbook_Open event cycle through all the Open workbooks for any with the name 'Normal Analysis' and if found, replaces all references in Formulas from 'Gamma Analysis' to 'Normal Analysis'

  22. #22
    Registered User
    Join Date
    12-07-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    13

    Re: Formula to reference an multiple cells to one cell.

    Quote Originally Posted by pjwhitfield View Post
    The only other way I can think to do this would be to review the list of Open work books to find which of the two was open and then use that to potentially amend the formulas in the book.

    eg Set the formulas up to use the ='Gamma Analysis'!B7 references and then in the Workbook_Open event cycle through all the Open workbooks for any with the name 'Normal Analysis' and if found, replaces all references in Formulas from 'Gamma Analysis' to 'Normal Analysis'
    Sorry I'm not sure how I should approach this, I may just settle down to have 2 separate LCG as it seems to be the easiest method. Thank you for your help =)

  23. #23
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Formula to reference an multiple cells to one cell.

    The replace formulas was actually easier than I had expected.

    Please Login or Register  to view this content.
    So basically set your workbook up to always reference the "Normal Analysis" workbook and place the above as the Workbook_Open event. when it opens it checks if Gamma Analysis is open and if so, finds/replaces all formula references to "Normal" with "Gamma"

  24. #24
    Registered User
    Join Date
    12-07-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    13

    Re: Formula to reference an multiple cells to one cell.

    Quote Originally Posted by pjwhitfield View Post
    The replace formulas was actually easier than I had expected.

    Please Login or Register  to view this content.
    So basically set your workbook up to always reference the "Normal Analysis" workbook and place the above as the Workbook_Open event. when it opens it checks if Gamma Analysis is open and if so, finds/replaces all formula references to "Normal" with "Gamma"
    Thank you worked like a charm! ^^

  25. #25
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Formula to reference an multiple cells to one cell.

    One thing I've just thought with the above, if your workbook is then saved with a Gamma Calculation in then the code stops working! Could be worth sticking the reverse IF statement in replacing Gamma with Normal so it does the code for whichever is open.

+ 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] I need a IF formula to reference multiple cells
    By nsmjc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-27-2014, 09:27 AM
  2. Replies: 3
    Last Post: 06-20-2014, 05:49 AM
  3. formula to combine multiple cells into single cell where reference is same
    By rexer231 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-12-2014, 11:44 AM
  4. Replies: 1
    Last Post: 12-15-2012, 08:42 AM
  5. Replies: 2
    Last Post: 06-10-2011, 03:33 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