Generating a list based on TRUE/FALSE table

choks90233

New Member
Joined
Jan 27, 2019
Messages
11
Office Version
  1. 2010
Platform
  1. Windows
Good afternoon everyone. I have a project I am working on that is absolutely breaking my brain. I am probably making it far more difficult than it needs to be, and if anyone can help me simplify it, I am more than open to the suggestions. For context, I have a line of items that are produced in set quantities, and I need to track them in a certain order. The problem is that I sometimes need to remove items due to defects. This in turn effects the order in which they will be stacked for the next stage of processing.

Table_Layout_Stack_Order.jpg


This is what I what I am envisioning in the end with the table on the left being the source of the items being produced and the table on the right being the stacked items before the next stage of processing. The colored numbers correspond to layers that I will show a list of further down. Each cell on the table on the right will have the matching designation from the table on the left provided that cell is checked. If the cell is unchecked, that will mean that particular item was removed and the next good item will have taken its place on the stack. Thats where it gets difficult. The Items are stacked in rows from right to left, and bottom to top.

Unchecked_Unsolved.jpg


This is what I am trying to avoid.

Uncheckd_Solved.jpg


This is what I am hoping to accomplish. Now, below is what I imagine is needed for a list to populate the table above. Maybe it's possible to populate the table directly without creating a list first but I cannot get my brain wrapped around the array formulas I need to make it work.

List_Complete.jpg


Please help!
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
How about this?

Excel
JKLMNOPQRSTUVWXYZAAABACAD
411TRUETRUETRUETRUETRUETRUETRUEG61G58F415E322E229D136
422TRUETRUETRUEFALSETRUETRUETRUEF62E59E416D323C230C137
433TRUETRUETRUETRUETRUETRUETRUEE63D510D417C324B231B138
444TRUEFALSETRUETRUETRUETRUETRUED64C511C418B325A232A139
455TRUETRUETRUETRUETRUEFALSETRUEC65B512A419A326G13340
466TRUETRUETRUETRUETRUETRUETRUEB66A513G320G227F13441
47ABCDEFGA67G414F321F228E13542
48Layer 1Layer 2Layer 3Layer 4Layer 5Layer 6
Sheet3
Cell Formulas
RangeFormula
J41:J46J41=SEQUENCE(6)
S41:AD47S41=LET(an,TOCOL(IF(K41:Q46,K$47:Q$47&$J41#,"")),f,FILTER(an,an<>""),rv,INDEX(f,SEQUENCE(ROWS(f),,ROWS(f),-1)),a,TRANSPOSE(WRAPROWS(rv,7,"")),n,ROWS(J41#)*COLUMNS(K47:Q47),ns,TRANSPOSE(WRAPROWS(SEQUENCE(n),7)),h,HSTACK(a,ns),CHOOSECOLS(h,TOROW(TRANSPOSE(SEQUENCE(2,6)))))
Dynamic array formulas.
 
Upvote 0
that looks fantastic. except my company has yet to upgrade to the latest version of excel and SEQUENCE is not a formula I can utilize.
 
Upvote 0
It would be helpful in the future if you have the version you're on in your profile.

Seems like it would be a mess without the dynamic array formulas.

I'd have to play around and see if I could replicate it in PowerQuery. Or doing it with VBA wouldn't be a big lift. Is VBA and or PowerQuery available to you?
 
Upvote 0
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
It would be helpful in the future if you have the version you're on in your profile.

Seems like it would be a mess without the dynamic array formulas.

I'd have to play around and see if I could replicate it in PowerQuery. Or doing it with VBA wouldn't be a big lift. Is VBA and or PowerQuery available to you?
I haven't used VBA much but it is available.
 
Upvote 0
Ok. The VBA below produced these results.

Book1
ABCDEFGHIJKLMNOPQRSTU
11TRUETRUETRUETRUETRUETRUETRUEG61G58F415E322E229D136
22TRUETRUETRUEFALSETRUETRUETRUEF62E59E416D323C230C137
33TRUETRUETRUETRUETRUETRUETRUEE63D510D417C324B231B138
44TRUEFALSETRUETRUETRUETRUETRUED64C511C418B325A232A139
55TRUETRUETRUETRUETRUEFALSETRUEC65B512A419A326G133
66TRUETRUETRUETRUETRUETRUETRUEB66A513G320G227F134
7ABCDEFGA67G414F321F228E135
Sheet1


VBA Code:
Sub test()
Dim r As Range:         Set r = Range("B1:H" & Range("H" & Rows.Count).End(xlUp).Row - 1)
Dim AR() As Variant:    AR = r.Value2
Dim RES As Variant:     ReDim RES(1 To UBound(AR, 2), 1 To UBound(AR) * 2)
Dim IDX As Integer:     IDX = 1
Dim PTR As Integer:     PTR = 1
Dim CNT As Integer:     CNT = 1


For i = UBound(AR) To 1 Step -1
    For j = UBound(AR, 2) To 1 Step -1
        If IDX Mod 8 = 0 Then
            IDX = 1
            PTR = PTR + 2
        End If
        If AR(i, j) Then
            RES(IDX, PTR) = Chr(j + 64) & i
            RES(IDX, PTR + 1) = CNT
            IDX = IDX + 1
            CNT = CNT + 1
        End If
    Next j
Next i

Range("J1").Resize(UBound(RES), UBound(RES, 2)).Value = RES
End Sub
 
Upvote 0
Here is also a way using some helper columns and regular old formulas.

Cell Formulas
RangeFormula
J1:J7,L1:L7,N1:N7,P1:P7,R1:R7,T1:T7J1=INDEX($E$11:$E$52,(MOD(ROW(A1)-1,7)+1)+(INT((COLUMN(A1)-1)/2)*7))
K1:K7,M1:M7,O1:O7,Q1:Q7,S1:S7,U1:U7K1=INDEX($F$11:$F$52,(MOD(ROW(B1)-1,7)+1)+(INT((COLUMN(B1)-1)/2)*7))
A11:A52A11=MOD(7-ROW(A1),7)+1
B11:B52B11=6-INT((ROW(A1)-1)/7)
C11:C52C11=INDEX($B$1:$H$6,B11,A11)
D11:D52D11=IF(C11,CHAR(A11+64)&B11,"")
E11:E52E11=IFERROR(IF(ROWS($E$11:E11)>COUNTA($D$11:$D$52),"",INDEX($D$11:$D$52,SMALL(IF($D$11:$D$52<>"",ROW($D$11:$D$52)-ROW($D$11)+1),ROWS($E$11:E11)))),"")
F11:F52F11=ROWS($F$11:F11)
 
Upvote 0
Solution

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top