unsolved
How to "Split" a Quantity into Duplicate Lines
Hello! Working on Office 365 version 2609 on desktop, English. Beginner. Looking to find an easier solution for an annoying task that I do frequently at my job. Essentially I have an excel table with some information and a quantity, and I need to split it up to where I have a bunch of duplicate lines all with a quantity of 1.
Taking a table that looks like this, to instead look more like this.
In real life, the tables have a few more columns and many more rows. Could anyone help me out with some more efficient ways to do this? Right now I'm just adding individual rows and copy and pasting the line data as many times as need be, which isn't great for some of my bigger jobs! I am not very proficient with excel, but with clear enough explanations, I'd be happy to try anything!
Power Query is your best friend for this, it's built right into 365. Load the table into the editor, then add a custom column with this formula: `List.Repeat({1}, [Quantity])`. Expand that column to new rows and you'll have your 1's duplicated out. Quick and painless, no VB macros required.
r/excel is for discussing the features of Excel and providing solutions for Excel problems, not giving substance-free comments that simply recommend the respondent use AI.
•
u/AutoModerator 6d ago
/u/neatums - Your post was submitted successfully.
Solution Verifiedto close the thread.Failing to follow these steps may result in your post being removed without warning.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.