+ Reply to Thread
Results 1 to 15 of 15

Permutation Calculation Formula with a TWIST

Hybrid View

  1. #1
    Registered User
    Join Date
    08-10-2011
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2010
    Posts
    16

    Permutation Calculation Formula with a TWIST

    Hi,

    I need help finding a formula that calculates 8 possible Yes/No/NA calculations from 8 questions to one output.

    So for instance, there are 8 questions that answer Yes/No/NA, and depending on how those questions are answered there is ONE choice that comes out. ALL of this info has already been manually entered into one big database spreadsheet tab. Someone actually did this manually, however now we want to apply this to an actual formula. How can I go about doing this? It's essentially like a lookup of some sort. I have hundreds of people taking this 8 question questionnaire and the results are logged into this excel file and now I need to apply this formula to get my ONE choice output from scanning this list of all possible permulations.

    How can I do this?

    Best,
    Chris

    (P.S.) I am using Excel 2010!
    Last edited by cnyoon2; 11-06-2013 at 03:42 PM.

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

    Re: Permutation Calculation Formula with a TWIST

    Hi Chris

    Couldn't you change your data into numbers? if you have 8 numbers

    and each number is 1 if n/a 2 if no 3 if yes then you have a number between 11111111 and 33333333
    so all you need is the match or vlookup function.

  3. #3
    Registered User
    Join Date
    08-10-2011
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Permutation Calculation Formula with a TWIST

    No sorry, pretty much I'm asking how to do a 8 cell Match lookup. It's a multi cell Vlookup, to return a value. Ideas?

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Permutation Calculation Formula with a TWIST

    Hi,

    So when you say "this info has already been manually entered into one big database spreadsheet tab", am I to assume that you have all the results for every single combination of answers?

    So, for example, if I had Person1's eight answers in Sheet1 A1:H1, and I also had this database of every single combination of answers in Sheet2 A2:I6562 (I make the number of combinations for 8 answers with 3 choices each to be 3^8=6561), with the answers in columns A-H and the desired result in column I, I could obtain Person1's result via:

    =INDEX(Sheet2!$I$2:$I$6562,MATCH(A1&B1&C1&D1&E1&F1&G1&H1,INDEX(Sheet2!$A$2:$A$6562&Sheet2!$B$2:$B$6562&Sheet2!$C$2:$C$6562&Sheet2!$D$2:$D$6562&Sheet2!$E$2:$E$6562&Sheet2!$F$2:$F$6562&Sheet2!$G$2:$G$6562&Sheet2!$H$2:$H$6562,,),0))

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  5. #5
    Registered User
    Join Date
    08-10-2011
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Permutation Calculation Formula with a TWIST

    Yes, this seems to be on the right track but i was wondering how i could make the desired result draw from the last column. XOR LX your correct in that I have a large database of all possible combinations in a separate sheet. Each combination has one desired result in the last column, how do I draw from that?

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Permutation Calculation Formula with a TWIST

    "...but i was wondering how i could make the desired result draw from the last column"

    Not sure I understand. Re-read the assumptions posted with my formula; it is doing precisely that (column I in my hypothetical set-up - obviously amend to suit your situation.)

    Regards

  7. #7
    Registered User
    Join Date
    08-10-2011
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Permutation Calculation Formula with a TWIST

    My permutation outcomes are in Sheet2 in from E4:O132. Yes there are only 132 options because if you run our particular series of questions there are only certain combinations, not a full 6232 which makes sense, just take as is. There are 8 answers to the questions and they are in E, F, G, H, with I being a blank column all the way down, then J, K, L, M and then N being a blank column then O has all the desired results.

    Similarly in my Sheet1 I have all the answers to people's questions, all in nice rows, in M, N, O, P and with Q being blank column then the rest in R, S, T, U. Not sure if the blank spaces are a factor but regardless I want to pull the last column, O in my sheet 2 to be called. I have the formula set in Sheet1 in column W (with column V being blank).

    Best,
    Chris

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Permutation Calculation Formula with a TWIST

    Ok, but just as you are unable to adapt the formula I posted to suit your actual ranges, I am equally unable to post a formula-based solution based on the information you are providing.

    It would seem that you posting a sample workbook is the best way forward now. Obviously remove/replace any sensitive/confidential information, though make sure that the actual set-up, cell/range references are identical to that of your actual workbook.

    Regards
    Last edited by XOR LX; 11-07-2013 at 03:58 PM.

  9. #9
    Registered User
    Join Date
    08-10-2011
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Permutation Calculation Formula with a TWIST

    Ok i cleaned it up and posted it here:
    Attached Files Attached Files

  10. #10
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Permutation Calculation Formula with a TWIST

    You were nearly correct with the formula you had in there. Should be, in W2 and copy down:

    =INDEX(Sheet2!$O$4:$O$132,MATCH(M2&N2&O2&P2&R2&S2&T2&U2,INDEX(Sheet2!$E$4:$E$132&Sheet2!$F$4:$F$132&Sheet2!$G$4:$G$132&Sheet2!$H$4:$H$132&Sheet2!$J$4:$J$132&Sheet2!$K$4:$K$132&Sheet2!$L$4:$L$132&Sheet2!$M$4:$M$132,,),0),)

    However, you'll notice that you will have quite a few #N/As in there, and I'm slightly confused, as you said that your Sheet2 contained all possible answer combinations. Take the first line, for example: the formula in W2 is returning #N/A as there simply isn't to be found anywhere in Sheet2 the combination of answers: N, N, M, N, Y, Y, M, N. Similarly for row 3, etc. (in fact you don't get your first genuine match until row 11).

    Regards

  11. #11
    Registered User
    Join Date
    08-10-2011
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Permutation Calculation Formula with a TWIST

    Thanks XorLX this works good HOWEVER,

    The problem I have is that it doesn't refresh automatically unless I click it inside it and then press enter. Is there a way to correct this?

    Meaning if I click and drag it down to copy it or if data changes, I dont see it refreshing.

    Best,

  12. #12
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Permutation Calculation Formula with a TWIST

    turn auto-calculation on in excel options
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  13. #13
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Permutation Calculation Formula with a TWIST

    If you only have one or a few formulas like that, that's a fine approach -- but every instance of it has to catenate 132 columns and then do a linear search for a match.

    If you catenated the results into an extra column in the table, and then sorted the whole table alphabetically by that column, you could use instead

    =if(lookup(M2&N2&O2&P2&R2&S2&T2&U2, leftColumn) = M2&N2&O2&P2&R2&S2&T2&U2, lookup(M2&N2&O2&P2&R2&S2&T2&U2, bothColumns), "Oops!")

    Or, if you were sure there would be a match, just

    =lookup(M2&N2&O2&P2&R2&S2&T2&U2, bothColumns)

    Both of those do a binary search, and either would be hundreds of times faster.
    Entia non sunt multiplicanda sine necessitate

  14. #14
    Registered User
    Join Date
    08-10-2011
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Permutation Calculation Formula with a TWIST

    Thank you all, this problem has officially been solved and i LOVE IT!!!!!!!!!!!!!!!!! how do i close it out as solved?

  15. #15
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Permutation Calculation Formula with a TWIST

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. advanced permutation formula
    By celestesutton in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-25-2012, 12:41 AM
  2. IRR Calculation with a twist
    By firetruck in forum Excel General
    Replies: 1
    Last Post: 09-01-2011, 05:32 PM
  3. Finding combination/permutation formula question
    By liur3n in forum Excel General
    Replies: 1
    Last Post: 08-26-2010, 06:45 PM
  4. Combination/Permutation Formula
    By bryanlindsey in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-18-2010, 04:25 PM
  5. Time calculation issue with a twist
    By theaudiobookguy in forum Excel General
    Replies: 2
    Last Post: 07-26-2009, 10:05 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