Split Excel Data into Multiple Files by Column Values using Python (fast & easy)

preview_player
ะŸะพะบะฐะทะฐั‚ัŒ ะพะฟะธัะฐะฝะธะต

๐——๐—˜๐—ฆ๐—–๐—ฅ๐—œ๐—ฃ๐—ง๐—œ๐—ข๐—ก
โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
This tutorial will show you how to separate Excel Data into Workbooks by Column Values. Instead of VBA, we will be using Python and the Pandas Library. The Python code from this tutorial can be a huge time saver. You can apply the code from this tutorial also any other Excel โ€“ you just need to tweak it slightly.

Download all the files & source code from the tutorial:

๐—ง๐—ข๐—ข๐—Ÿ๐—ฆ ๐—”๐—ก๐—— ๐—ฅ๐—˜๐—ฆ๐—ข๐—จ๐—ฅ๐—–๐—˜๐—ฆ
โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€

๐—–๐—ข๐—ก๐—ก๐—˜๐—–๐—ง ๐—ช๐—œ๐—ง๐—› ๐— ๐—˜
โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€

โ˜• ๐—•๐˜‚๐˜† ๐—บ๐—ฒ ๐—ฎ ๐—ฐ๐—ผ๐—ณ๐—ณ๐—ฒ๐—ฒ?
ะ ะตะบะพะผะตะฝะดะฐั†ะธะธ ะฟะพ ั‚ะตะผะต
ะšะพะผะผะตะฝั‚ะฐั€ะธะธ
ะะฒั‚ะพั€

*What kind of Excel Automation would you like to see next?* Let me know in the comments ๐Ÿ˜ƒ

CodingIsFun
ะะฒั‚ะพั€

Thank you so much. You helped me automate 3 hours of weekly work for an FTE. Great video

daveg
ะะฒั‚ะพั€

Best thing Iโ€™ve ever seen so far about excel+python

mayday_excelgroup
ะะฒั‚ะพั€

Hello, coding is fun. Sorry I don't know your good name .

You are welcome and thanks for your comments below. I actually love python coding. I came to learn it as I mentioned before for more than 1 year now . With your videos you are showing how much we can do with python. I prefer using python instead of VB since it is much easier and script oriented and it is easy for me to learn. Thank you again.

bak
ะะฒั‚ะพั€

That was perfect, exactly what I was looking for, thanks!! Concise, yet complete. :)

marco_rock_s
ะะฒั‚ะพั€

New subscriber
Thank you โœจ
This would definitely save me a lot of time
I followed your tutorial which made me super happy ๐Ÿ˜Š but I need the master file format and data validation sheet ๐Ÿ™ƒ

eryabolonha
ะะฒั‚ะพั€

o video que eu estava procurando h'a muito tempo, thankss

marciorodriguesmota
ะะฒั‚ะพั€

Nice coding. I just need to look into it more deeply to make sure I understand it well.
Thanks

bak
ะะฒั‚ะพั€

Great video! Thanks so much. Do you know how we can split the files while maintaining the excel formulas in the master file?

austenlowitz
ะะฒั‚ะพั€

I need a solution in one column i have a lot of data and blank cells what requirements was all values from that sheet need to update in one file and blank value records to the 2nd CSV file is that possible

veginetikalyanprasadchowda
ะะฒั‚ะพั€

Not sure if you will see this but wondering what to do when I see this error:

InvalidWorksheetName: Invalid Excel character '[]:*?/\'

When looking at my datafile I noticed some Customer_Name's have "/" in them. Any help?

beboldermedia
ะะฒั‚ะพั€

How do we get get new excel sheets by Columns thatโ€™s mean if it has 15columns and I need only 3 specific columns

jhonnidarshan
ะะฒั‚ะพั€

I am running into errors with Unique_value where it keeps saying โ€œfirst arguement must be string or compli pattern.โ€ Also when I do + โ€˜.xlsxโ€™ it says something like cannot combine float and string. But the code works and I can see the files createdโ€ฆ any explanation on that?

worldstreetfoodexplorer
ะะฒั‚ะพั€

Hey - I took your code and just changed the Column Name to work with my use case. After going through a few thousand seperations, I'm getting this error -- TypeError: first argument must be string or compiled pattern -- any thoughts?

mikebeaton
ะะฒั‚ะพั€

Pandas is failing to process 100 million records around 18.5 gb csv file. Any idea how to split into smaller records, I also tried polars it is generated only one file of 100k

Viralvlogvideos
ะะฒั‚ะพั€

Hi! Thanks for the video as it help me a lot. Can I know how to save the final multiple file into csv?

wnibwi
ะะฒั‚ะพั€

By using your code, "can only .str accessor with string valuse!" This error will shown?

trendingnow
ะะฒั‚ะพั€

How do I format the output excel sheet? Like column width, auto adjust size of column to content

varatharajinpayanangal
ะะฒั‚ะพั€

Great videos! Thank you so much! Quick question: What if the column values I am splitting by are numeric instead of strings? I keep getting an error with 'str.contains', but when I use a different column that are string values everything works fine.

kevinthomas
ะะฒั‚ะพั€

Nice! Thank you! How can I split one excel file with multiple sheets into multiple files with multiple sheets based on one row/value in each sheets?

xHeroGirlx