+ Reply to Thread
Results 1 to 13 of 13

Create Array of Letters and Numbers

  1. #1
    Registered User
    Join Date
    04-24-2019
    Location
    Vancouver, BC, Canada
    MS-Off Ver
    Excel 2016
    Posts
    5

    Create Array of Letters and Numbers

    Hello,

    I'm trying to create a framework or array with two values in the attached spreadsheet. The idea is to create a varying number of points with a central spine. I tried to get this to work with some IF statements but I've run into a roadblock. Is there an excel function that can accomplish this grid or do I need to go with VBA.

    Example 1:
    Input
    6 Points
    Line after 4
    S1, S2, S3, S4, M1
    S5, S6, M2

    Example 2:
    Input
    9 Points
    Line after 3
    S1, S2, S3, M1
    S4, S5, S6, M2
    S7, S8, S9, M3

    Example 3:
    Input
    9 Points
    Line after 3
    S1, S2, S3, M1, S4, S5
    S6, S7, M2, S8, S9

    Any and all help is greatly appreciated!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    07-21-2021
    Location
    Norfolk, UK
    MS-Off Ver
    Excel 2003, 2007, 2013, 2019
    Posts
    215

    Re: Create Array of Letters and Numbers

    I have looked at your sample spreadsheet and have a few questions.

    Is there a maximum size (rows and columns) to your framework?
    Are the order and location of the identities within the framework critical (I note there are gaps in the 2nd row of your sample.)?
    How are you going to use this data, once collected? There are no formulae referring to these cells.


    Stephen
    Regards,

    Stephen

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Create Array of Letters and Numbers

    Explain HOW your expected answer should be derived.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  4. #4
    Registered User
    Join Date
    04-24-2019
    Location
    Vancouver, BC, Canada
    MS-Off Ver
    Excel 2016
    Posts
    5

    Re: Create Array of Letters and Numbers

    Hi Stephen and Glenn,

    Thanks for responding, apologies for not providing enough information. I've included the desired outcome of what I hope to accomplish with this sheet, again I'm unsure how to begin to approach this my, originally to layout the S-points I was using a brute force method of each cell having a IF statement like the following
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    , however this quickly falls apart when the M-point is placed as the numbers fall out of sequence.

    Attachment 787385

    Many Thanks
    Attached Images Attached Images

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Create Array of Letters and Numbers

    One of the major issues I have with sample files is the inclusion of too much irrelevant stuff in a sheet. It leaves no room for experimentation, and totally obsures the message.

    I have cut your sheet back to the bare bones and I think I follow it. I'm not saying I can help... but I do need some clarification.



    1. Check the file. Answer ALL of the questions I have asked. Correct me where I'm wrong.

    2. Include 2 further examples, using the model I have used, of input and desired result.

    Then we'll see...
    Attached Files Attached Files

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Create Array of Letters and Numbers

    I've played with this for just over an hour... painful! IF my understanding is correct, try this.

    Helper column (to generate sprinklers per row):

    =IF(ROWS(U$3:U3)<=ROUNDUP($B$5/$B$4,0),MIN($B$4,$B$5-SUM(U$2:U2)),"")


    The fixed point, around which the table is generated is the M number, copied down:

    =IF(ROWS(L$3:L3)>ROUNDUP($B$5/$B$4,0),"","M"&ROWS(L$3:L3))


    The S numbers to the LEFT of M are generated using this, copied to the LEFT and down:

    =LET(eR,$B$4*(ROWS(K$3:K3)-1),lM,IF($U3="","",IF($U3<$B$4,ROUNDUP($U3/2,0),$B$3)),c,COLUMNS(K3:$K3),IFERROR(IF(lM-(c-1)<1,"",IF(c<=lM,"S"&eR+lM-(c-1))),""))


    The S numbers to theRIGHT of M are generated using this, copied to the RIGHT and down:

    =LET(c,COLUMNS($M3:M3),lP,MID($K3,2,255),er,$B$4*(ROWS(M$3:M3)-1),IFERROR(IF(lP-er+c>$U3,"","S"&lP+c),""))

    Does it work?
    Attached Files Attached Files

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Create Array of Letters and Numbers

    V2... without the helper.
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 07-14-2022 at 04:59 AM.

  8. #8
    Forum Contributor
    Join Date
    07-21-2021
    Location
    Norfolk, UK
    MS-Off Ver
    Excel 2003, 2007, 2013, 2019
    Posts
    215

    Re: Create Array of Letters and Numbers

    Here is a much LESS sophisticated approach to the same problem.

    Perhaps its most obvious disadvantage is that it requires you to find space on your worksheet for 3 extra tables. However, I like this mode of approach because the logic appears clearer - at least to me.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-24-2019
    Location
    Vancouver, BC, Canada
    MS-Off Ver
    Excel 2016
    Posts
    5

    Re: Create Array of Letters and Numbers

    Glenn this is fantastic, it works perfectly. Thank you so much for all of your help!

    Do you know if there's an option to substitute the let function to make it usable with Excel 2016?

  10. #10
    Forum Contributor
    Join Date
    07-21-2021
    Location
    Norfolk, UK
    MS-Off Ver
    Excel 2003, 2007, 2013, 2019
    Posts
    215

    Re: Create Array of Letters and Numbers

    Quote Originally Posted by ScoRat View Post
    Do you know if there's an option to substitute the let function to make it usable with Excel 2016?

    My solution at #8 was built in EXCEL 2013 and so would be useable in your excel version.

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Create Array of Letters and Numbers

    Oh dear, sorry about that. I was certain you were using O365.

    I hope you were able to test it on an O365 system beofre saying it was OK...

    I set up a series of Named Ranges to do the intermediate calculations and (I think) I have reproduced it all on your original sheet.

    Test & report back....
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    04-24-2019
    Location
    Vancouver, BC, Canada
    MS-Off Ver
    Excel 2016
    Posts
    5

    Re: Create Array of Letters and Numbers

    Thank you all for your help! I really appreciate it!

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Create Array of Letters and Numbers

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please select "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.

+ 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. Replies: 13
    Last Post: 07-30-2014, 12:03 PM
  2. [SOLVED] matching index of an array - works for numbers not letters
    By gryffin13 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-27-2012, 10:43 AM
  3. Replies: 8
    Last Post: 06-07-2012, 09:14 AM
  4. Replies: 4
    Last Post: 03-25-2012, 03:09 AM
  5. Replies: 2
    Last Post: 12-01-2010, 02:29 PM
  6. create self-generating numbers with letters and numbers
    By cxlough41 in forum Excel General
    Replies: 11
    Last Post: 01-03-2006, 09:20 PM
  7. Replies: 1
    Last Post: 09-15-2005, 10:05 PM

Tags for this Thread

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