How to split a table into multiple tables based on value in a column?
Show older comments
Hello,
I am reading in an excel file that has 2 columns of data. One of them has a lot number and the other has row/col numbers.
I've made a table that holds this information, however, I would like to make multiple tables for every set of lot numbers.
I've attached an example excel sheet. In this example there are 2 different lot numbers, so I would need it to make 2 different tables for each lot number with each corresponding row, col number! I also need it to be able to adjust if there are more than 2 different lot numbers because the sheet is always updated.
Thanks!
3 Comments
Steven Lord
on 19 Mar 2025
What are you hoping / planning to do with these "multiple tables"? There is likely a better way to achieve what you're trying to do that creating an arbitrary number of variables (with names set only at runtime?) such as perhaps using the grouping functions like groupsummary or grouptransform.
Stephen23
on 19 Mar 2025
Often splitting up data makes it harder to process. Consider instead:
KD
on 20 Mar 2025
Accepted Answer
More Answers (0)
Categories
Find more on Tables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!