Complicated Data analysis

idkman

New Member
Joined
May 31, 2023
Messages
4
Office Version
  1. 2021
Platform
  1. Windows
I have data sets that I need to make into groups based on a certain set parameters. So first I'd like to have the VBA scan the data and group together entries that are similar by one data point. Then do that again and group those groups by another data point. Then of the ones that are grouped with that similarity I want to optimize the data to be in another group based on another set of data in the array and these groups have a set maximum value that it can not be more than. after that, I need it to take those groupings and optimize it again to pair the groupings based on a data value but this time with a maximum value as well that the groups need to add to.

So For example: If i was talking about books, I have 2,000 books and I wanted to group books together that are all the same author, then group by the same genre, Then once they are grouped by author and genre I need it to add to being a specific length I have for my book shelf but I also need to know what height to build my shelves at and I have a max shelf height. So I need it to calculate what height the shelf will need to be at and which books can fit on one shelf together based on the length of my bookcase, and Ideally also include how many shelves total I will need and how many bookcases.

I've tried a lot of different things and nothing has really been seamless and automated the way I want it to. I would like to run the vba program and have it to all of that mathematically and seamlessly, I've also tried using solver in conjunction with VBA to get the optimization but it hasn't worked how I need it to. Please let me know if you have an suggestions of how to get this to run seamlessly the way I need it to, I'm open to any and all suggestions. Thanks.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Welcome to the Mr. Excel forum. Mr. Excel has a great tool that helps the you help the forum. It is called xl2bb add in (link below). It allows you to share a mini worksheet with formulas, formatting, etc. to the forum so the forum doesn't have to guess how to build your scenario. Please share a portion of your data (in your example columns seem to be more important that rows, so maybe 15-20 rows of all your populated columns).

Thanks in advance.

But, to address your question, why are you seeking a VBA solution? A power query or power pivot solution may provide you with a solution. Even a simple pivot table could work.

Regarding your bookshelf? Do you already have a width and height of the shelving unit? If you have multiple shelving units, do you want to wrap from shelf to shelf within the unit or across combined width of all units?
 
Upvote 0
Thank you for your response. I'm open to any way to get too the solution I need but I have the most experience in VBA and haven't used anything else. With the shelving, the height of the shelves are variable but the length and width are fixed. The total height of the book case would be fixed as well but were the shelves go would change. Also Any data longer than half the shelf length, and deeper than the shelf needs to be disregarded. And once things are placed with a location, It can be disregarded as well.

I'm unable to use the xl2bb but attached is an image. So with this specifically it would be first grouped by location which there are a lot of locations, then by height which ranges from 119-6, then we would want to take those and find combinations of tools that the of lengths add up to no more than 140in but no less than 130in, so one tool can't be more than 70in long and it can't be more than 38 deep. And then once we have combinations that will fit on a single shelf we would want it to make a rack that has 3 shelves but is no more than 168in tall and has 12in of empty space between the height of the tool and the shelf above.
1685557310444.png
 
Upvote 0
if you can't use the xl2bb then please post the data as a table. Images while helping to visualize really do not save the forum any time. As they have to completely enter your data manually. and that transcribing can have typos/omissions/etc and lead to errors.
 
Upvote 0
Item #tool #LocationLengthDepthHeightNew Location
603-0698_00__2BK3TL004331_BK3_AA-207824257
58B-54-04580_01__2BG1TL002342GG-1712614977
58B-80-50260_00__2BG1TL006422GG-1710714860
EM8436_01_XCTL002012GG-1710714860
58F-54-31300_00__2BG1TL002349GG-176111279
333-0646_00_BK3TL001083FF-147710283
58D-54-04890_00__2BG1TL003605EE-161039796
612-7837-G_00__BK3TL001796OT-15509755
EG0632_00__YEPKTL001051FF-131199586
XB3057_002_XCTL001168GG-10799390
58F-54-01822_01__2BG1TL001175GG-12799390
58F-54-20280_00__2BG1TL004048GG-12799390
EK1208_000_XCTL001173GG-11988159
EM5037_000_XCTL001139GG-5798151
58B-54-01052_00__2BG1TL001052FF-101098090
212-0020_00_YE1PTL000726CC-12488082
310-1567-G_01_BK3TL000920EE-7707690
582-7718_01_A__BK3TL003045OT-18867490
EJ7468_001_XCTL001171GG-111437482
212-0023_01__YEPTL000721CC-11407480
572-7590_00__2BK3TL005108BB-6787420
269-8688_08TL001182GG-15737371
58B-54-70470_01__2BG1TL006683OT-23977083
571-5657-G_01__BK3TL004351DD-8566898
444-8758_00_BK3FX002085EE-17976794
AFH210291_J__GN1FIXF-AF06116EE-7626746
58E-54-22041_00__2BG1TL003231EE-16606583
EK6627_000_XCTL001148GG-7656581
474-4562_00__BK3FX001527FF-19646450
 
Upvote 0
Item #tool #LocationLengthDepthHeightNew Location
333-9678_00_YE1PTL000728CC-12553895
350-7161_01__BK3TL000538BB-6353883
205-4106_01_BK3TL000506BB-1653871
301-0964-1_01TL001821OT-21663869
368-4425-G_01__BK3TL000602BB-16483856
234-0385_05__2BK3TL000621BB-18293855
357-4843_04__2YE1TL001778AA-1A313775AA-1A
435-3943_00_BK3TL001186GG-16583750
486-0499_00__BK3TL001766OT-11543750
EM4797_000_XCTL001114GG-2423746
276-3113_05_BK3TL000559BB-9603745
418-3682_03__BK3TL001785OT-13513744
243-4248_00_BK4TL000676CC-5373725
299-3957_02_BK3TL000803DD-8483682
256-1370_00__YEPTL000809DD-9483682
367-2568_04__2BK3FX002668OT-17443676
540-0865-G_02__2BK3TL005157OT-23503676
XB3780_02__2BG1TL000923FF-1523675
456-0270_01_BK3TL001181GG-14563674
AA108048_A__2GN1TL006668_BK3_EE-14573666
AA108049_A__2GN1TL006670_BK3_FF-9633666
487-0512_00__BK3TL001805OT-10393664
511-0868-G_00__BK3TL001446BB-4363657
333-9675_00_YE1PTL000582BB-13443655
465-5920_00_2BK3FX001250FF-17453654
365-0742_00_BK3TL000457AA-12373652
EL3192_003_XCTL000998FF-3553652
EL6117_000_XCTL001142GG-5493652
347-9752_02_BK3TL000472AA-13653651
215-9191_00_YE1PTL000902EE-4483651
569-5245-G_00__2BK3FX002578EE-9603650
58E5410000_00_XCTL001117GG-2583650
365-0729_00_BK3TL000465AA-12493648
 
Upvote 0

Forum statistics

Threads
1,223,912
Messages
6,175,341
Members
452,638
Latest member
Oluwabukunmi

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