Mar 07 2023 11:19 AM
Hello,
I have been trying to work on a formula to combine the 5 tables of data into one table and sort into categories for over a week. I am truly stuck. Could someone please assist me in this endeavor? The screenshots will be uploaded.
Mar 07 2023 12:13 PM
A couple initial responses to your posting.
1. Those pretty clearly aren't your real tables.
2. It's not clear what you are expecting to enter into the columns under the headings in the "Master Table" since you left those rows blank
Rather than images, since you've gone to the trouble (it would appear) to create actual spreadsheets with those entries, why don't you post those actual (albeit hypothetical) spreadsheets on OneDrive or GoogleDrive, and paste a link here that grants edit access. In addition to doing that, please clarify what I point to in #2 above. And maybe give an idea of the magnitude of the actual tables. How many rows? How interrelated are they (I'm alluding to the recurring initials in your example file)?
Mar 07 2023 01:13 PM - edited Mar 07 2023 01:14 PM
Solution
I'll step you through my solution.
1. Stack the tables with VSTACK- called 'tStack'
=VSTACK(Table1, Table2, Table3, Table4, Table5)
2. Pull the 'Initials' from the tStack
=TAKE(tStack, , -1)
3. Pull the 'Area' from tStack
=TAKE(tStack, , 1)
4. Define a constant called 'order' to help with the ordering of columns in the end result:
={"NORTH"; "SOUTH"; "EAST"; "PAC NORTH"; "PAC SOUTH"; "TMU"; "FLT DATA"; "IAP"; "DAP"; "TRNG"}
5. 'Organize' Lambda checks a unique listing of areas in the order you prefer left to right. It locates potentially multiple initials per area, stacks it vertically, and then stacks results horizontally.
Organize Lambda
=LAMBDA(a,v,LET(filtered, FILTER(Initials, Area = v), IFERROR(HSTACK(a, VSTACK(v, filtered)), "")))
6. REDUCE delivers the solution.
=DROP(REDUCE("",Order,Organize),,1)
Mar 07 2023 01:56 PM
Hello @Patrick2788,
Thank you for taking the time to figure this out. That's exactly what my goal was. I have a Userform where they input their Area and Initials. Then it goes into the 5 tables. From there I wanted the initials to be sorted by Area which I see you did.
I appreciate you drawing the steps out for me however what cell do I put all of these codes in?
Also, is there a way to not allow duplicate initials from being entered into the Userform?
Thanks
Mar 07 2023 02:01 PM
Mar 07 2023 03:34 PM
Mar 08 2023 06:20 AM
Mar 08 2023 07:12 AM