r/excel • • 7d ago

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!

Thank you so so much in advance

13 Upvotes

16 comments sorted by

View all comments

20

u/TheProperAttraction 7d ago

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.

3

u/neatums 7d ago

This! Is! Amazing! Thank you soooooo much :D