+ Reply to Thread
Results 1 to 31 of 31

Complex formula to create seat assignment

  1. #1
    Forum Contributor
    Join Date
    06-10-2012
    Location
    UAE
    MS-Off Ver
    Excel 2016
    Posts
    132

    Complex formula to create seat assignment

    Hello everyone,

    i am looking to create some formulas that will allow me to do the following:


    See if a number is present in an array
    if the number is present, where it is located according to a specific table.

    the goal is to be able to assign seats for an event that i am doing and make sure that all are seated

    below is a picture of what my excel looks like

    Floor plan here


    i need to populate the following column



    Seated
    Row
    Seat Number


    Any help is welcome

    Thank you
    Last edited by didierkassas; 02-07-2016 at 05:55 AM.

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Help with complex formula

    hello and welcome to forum

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,187

    Re: Complex formula to create seat assignment

    Please upload an Excel file.

  4. #4
    Forum Contributor
    Join Date
    06-10-2012
    Location
    UAE
    MS-Off Ver
    Excel 2016
    Posts
    132

    Re: Complex formula to create seat assignment

    please find attached the file
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,187

    Re: Complex formula to create seat assignment

    Are all seats given a unique number i.e. independent of row / column?: in your plan numbers would be 1 to140 ( 4 x 35)

  6. #6
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Complex formula to create seat assignment

    in E2 copy paste below then hold control and shift together and then hit enter to make it array formula and drag down

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    In F2 copy paste below then hold control and shift together and then hit enter to make it array formula and drag down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Array...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    06-10-2012
    Location
    UAE
    MS-Off Ver
    Excel 2016
    Posts
    132

    Re: Complex formula to create seat assignment

    hey John

    each town has individual numbering, so our tickets are
    Row A: 1 to 35
    Row B: 1 to 35
    Row AA: 1 to 35
    Row BB: 1 to 35

  8. #8
    Forum Contributor
    Join Date
    06-10-2012
    Location
    UAE
    MS-Off Ver
    Excel 2016
    Posts
    132

    Re: Complex formula to create seat assignment

    That's perfect it worked, it is quite a complex formula. thank you

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,751

    Re: Complex formula to create seat assignment

    For the row, paste this into E2 and copy down:

    =IF(COUNTIF($L$4:$AT$4,A2),$K$4,IF(COUNTIF($L$5:$AT$5,A2),$K$5,IF(COUNTIF($L$12:$AT$12,A2),$K$12,IF(COUNTIF($L$13:$AT$13,A2),$K$13,""))))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  10. #10
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Complex formula to create seat assignment

    you are welcome Dideierkassas!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

    You can thank here by clicking add reputation icon below the post of the members who helped you, this adds to the reputation of member shown in form of green bar below their names

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,751

    Re: Complex formula to create seat assignment

    Quote Originally Posted by didierkassas View Post
    That's perfect it worked, it is quite a complex formula. thank you
    It would be helpful if Hemesh could explain how it works so that we can learn from this.

  12. #12
    Forum Contributor
    Join Date
    06-10-2012
    Location
    UAE
    MS-Off Ver
    Excel 2016
    Posts
    132

    Re: Complex formula to create seat assignment

    for the Seat, i just copy the same formula?

  13. #13
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Complex formula to create seat assignment

    @ AliGW ! which part would you like to know.

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,751

    Re: Complex formula to create seat assignment

    Quote Originally Posted by hemesh View Post
    @ AliGW ! which part would you like to know.
    Can you explain the use of MMULT and TRANSPOSE? I understand INDEX and MATCH.

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,751

    Re: Complex formula to create seat assignment

    Quote Originally Posted by didierkassas View Post
    for the Seat, i just copy the same formula?
    Who are you asking? If you are asking me, then no: use Hemesh's solution. There are two formulae, one for the row and one for the seat.

  16. #16
    Forum Contributor
    Join Date
    06-10-2012
    Location
    UAE
    MS-Off Ver
    Excel 2016
    Posts
    132

    Re: Complex formula to create seat assignment

    it's ok i found the error, the selection had shifted

    now all is working perfectly
    Last edited by didierkassas; 02-07-2016 at 05:54 AM.

  17. #17
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Complex formula to create seat assignment

    @ AliGW, MMULT Stands for matrix multiplication and needs two arrays
    first array checks if value is available and generates array of 0's and 1's
    --(($L$4:$AT$5=$A2))

    Second array
    TRANSPOSE(COLUMN($L$4:$AT$4)^0)
    converts columns into rows and push the value of 1 as any number raised to power 0 is 1 and gives the results as {0,1} or {0,0} or {1,0}

    Hope that helps

  18. #18
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,751

    Re: Complex formula to create seat assignment

    @Hemesh

    I think there is enough here for me to work the rest out. Thank you!

  19. #19
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Complex formula to create seat assignment

    You are welcome AliGW.

  20. #20
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,751

    Re: Complex formula to create seat assignment

    Quote Originally Posted by hemesh View Post
    @ AliGW, MMULT Stands for matrix multiplication and needs two arrays
    first array checks if value is available and generates array of 0's and 1's
    --(($L$4:$AT$5=$A2))

    Second array
    TRANSPOSE(COLUMN($L$4:$AT$4)^0)
    converts columns into rows and push the value of 1 as any number raised to power 0 is 1 and gives the results as {0,1} or {0,0} or {1,0}

    Hope that helps
    I have just managed to get round to looking at this in detail. I understand the MMULT section, but the thing that is confusing me is how the TRANSPOSE section could ever result in 0. Can anyone advise? I must be missing something obvious ...

  21. #21
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Complex formula to create seat assignment

    Quote Originally Posted by AliGW View Post
    how the TRANSPOSE section could ever result in 0. Can anyone advise?
    It can't!

    TRANSPOSE is used to generate a VERTICAL array of 1s.

    {1;1;1;1;1} = vertical array
    {1,1,1,1,1} = horizontal array

    Any number to the power of 0 = 1.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  22. #22
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,751

    Re: Complex formula to create seat assignment

    That's what I thought, Tony, so how does this work?

    TRANSPOSE(COLUMN($L$4:$AT$4)^0)
    converts columns into rows and push the value of 1 as any number raised to power 0 is 1 and gives the results as {0,1} or {0,0} or {1,0}

  23. #23
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Complex formula to create seat assignment

    Let's assume the range is A1:E1...

    TRANSPOSE(COLUMN(A1:E1)^0)

    COLUMN(A1:E1)^0 generates this horizontal array:

    {1,1,1,1,1}

    Then TRANSPOSE turns it into a vertical array:

    TRANSPOSE({1,1,1,1,1})

    {1;1;1;1;1)

    MMULT is a very difficult function to understand. Years ago I wrote this explanation for someone:

    http://www.tech-archive.net/Archive/.../msg00758.html

  24. #24
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,751

    Re: Complex formula to create seat assignment

    Thanks, Tony. I do understand the MMULT section and now the TRANSPOSE section, but what I don't get is how they result in the {0,1}, {0,0} or {1,0} mentioned. This is where I am at a loss.

  25. #25
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Complex formula to create seat assignment

    After reading it many times...

    Quote Originally Posted by hemesh View Post
    ...and gives the results as {0,1} or {0,0} or {1,0}
    hemesh might have meant that those are the results when the 2 arrays are multiplied together...

    --(($L$4:$AT$5=$A2)) * TRANSPOSE(COLUMN($L$4:$AT$4)^0)

  26. #26
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,751

    Re: Complex formula to create seat assignment

    Thanks, Tony. I'm afraid I'm just not getting this at all, but thanks for trying to enlighten me!

  27. #27
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Complex formula to create seat assignment

    As Tony sir said, in the post #25, it may be any result out of {0,0} or {0,1} or {1,0}.

    Please go through Post #23, Link provided by Tony sir, you will be understanding a lot about it.

  28. #28
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,751

    Re: Complex formula to create seat assignment

    Quote Originally Posted by hemesh View Post
    As Tony sir said, in the post #25, it may be any result out of {0,0} or {0,1} or {1,0}.

    Please go through Post #23, Link provided by Tony sir, you will be understanding a lot about it.
    You might be able to tell from my avatar that I am female.

    I have looked at Tony's link and it has not helped me. It would be really helpful (but if you don't have time to, I'll understand) if you could go through step-by-step to explain what is happening. I have tried using the Evaluate Formula option, but I haven't yet had the light bulb moment.

    {0,0} or {0,1} or {1,0}
    How exactly do we arrive at these three possible results?

  29. #29
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Complex formula to create seat assignment

    @ Ali,
    first part --(($L$4:$AT$5=$A2)) check value of A2 in a matrix of 2 rows and 35 columns and generates array of 0's and 1's as below in same matrix of 2R and 35C
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
    matched value have results of 1's and unmatched have value of 0

    now second array TRANSPOSE(COLUMN($L$4:$AT$4)^0), transpose converts column into row and and ^0 converts columns numbers as 1's as below
    {1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1}

    now both matrices generated from array one and array two gets multiplied and throws the results in form of 2 rows and 1 column
    expected results that we can interpret are
    if there is no match found in array one then it will have all zeros thus result will be {0;0}
    if there is match is found in array one in first row then result will be {1;0}
    if there is match found in array one in second row then result will be {0;1}

  30. #30
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,751

    Re: Complex formula to create seat assignment

    Thanks, Hemesh - I'll study this.

  31. #31
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Complex formula to create seat assignment

    @ Ali, You are welcome.

+ 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. Complex if formula
    By BROrion89 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-30-2015, 05:36 PM
  2. [SOLVED] Use an existing cell formula for creating a new more complex formula
    By dubcap01 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-23-2014, 07:41 AM
  3. complex AVG formula
    By koosh1986 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-22-2014, 06:46 PM
  4. Complex formula using IF THEN ELSE
    By daymaker in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-05-2011, 10:05 AM
  5. Complex Formula using IF THEN ELSE!
    By daymaker in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-05-2011, 01:10 AM
  6. Complex IF Formula
    By davo1224 in forum Excel General
    Replies: 8
    Last Post: 12-15-2010, 05:39 PM
  7. Need Help with Complex??? Formula
    By sheppjr in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-12-2006, 12:34 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