How to use Python in Excel - Beginner Tutorial
Вставка
- Опубліковано 2 чер 2024
- 🔥 Learn Excel in just 2 hours: kevinstratvert.thinkific.com
In this step-by-step tutorial, learn how you can use Python in Microsoft Excel. If you've never heard of Python before, it's a powerful and popular programming language that has many libraries and packages that help you with data manipulation, statistical modeling, machine learning, and data visualization. By bringing Python into Excel, you now get all of these benefits directly in one place. We'll start with the absolute basics of how you even get started using Python in Excel and then we'll look at some of the additional power you get added on top of Excel.
📚 RESOURCES
- Sample Excel workbook to follow along: 1drv.ms/x/s!AmxrofZZlZ-whapuy...
- CTRL + Alt + Shift + P to insert Python code
- CTRL + Shift + U to expand formula editor
- CTRL + Alt + Shift + M to toggle between Python object and Excel value
- Pandas documentation: pandas.pydata.org/docs/
- Bing Chat: www.bing.com/chat
⌚ TIMESTAMPS
00:00 Introduction
00:40 How to insert Python code
01:57 Multi-line editor
02:38 Hello World example
04:01 Assign value to variables
05:07 Reference variables
06:01 Row major order
07:42 xl function
09:10 Python output in Excel calculations
09:39 Calculation options
10:56 Python object vs. Excel value
13:39 Import data with Power Query
14:15 Libraries
15:10 Pandas describe method
16:48 Matplotlib library and charting
19:32 Wrap up
📺 RELATED VIDEOS
- Playlist with all my videos on Excel: • ❎ How to use Excel
📩 NEWSLETTER
- Get the latest high-quality tutorial and tips and tricks videos emailed to your inbox each week: kevinstratvert.com/newsletter/
🔽 CONNECT WITH ME
- Official web site: www.kevinstratvert.com
- LinkedIn: / kevinstratvert
- Discord: bit.ly/KevinStratvertDiscord
- Twitter: / kevstrat
- Facebook: / kevin-stratvert-101912...
- TikTok: / kevinstratvert
- Instagram: / kevinstratvert
🎒 MY COURSES
- Go from Excel novice to data analysis ninja in just 2 hours: kevinstratvert.thinkific.com/
🙏 REQUEST VIDEOS
forms.gle/BDrTNUoxheEoMLGt5
🔔 SUBSCRIBE ON UA-cam
ua-cam.com/users/kevlers?...
🙌 SUPPORT THE CHANNEL
- Hit the THANKS button in any video!
- Amazon affiliate link: amzn.to/3kCP2yz (Purchasing through this link gives me a small commission to support videos on this channel -- the price to you is the same)
#stratvert #excel #python - Наука та технологія
Go from Excel novice to data analysis ninja in just 2 hours: kevinstratvert.thinkific.com/
Learn the fundamentals of Python in just one hour: ua-cam.com/video/b093aqAZiPU/v-deo.htmlsi=Rv1r2vAqBnsQfPWO
Watch even more free Excel tutorials: ua-cam.com/play/PLlKpQrBME6xLYoubjOqowzcCCd0ivQVLY.html
Get the latest high-quality tutorial and tips and tricks videos emailed to your inbox each week: kevinstratvert.com/newsletter/
Kevin, can we genuinely do something together?
I was wondering when something like this would come out from Kevin! Thanks again for being the go-to for getting started with apps/programs that somebody would possibly hardly know anything about. Your guides are always so beginner friendly and motivating.
Thank you brother. You're helping me prepare for a post-interview assessment. God bless you.
This is great! I pay attention to this in the coming few weeks, this is a great video! I have been using python for automating workflows and this is really helpful.
Absolutely brilliant way of navigating through excel using Python,you've made it so easy to understand, good job Kevin😊,Dubai
I am a web dev that happens to be working as a middle manager and this has sparked an interest for my actual job!
Dear Kevin! You opened my eyes for using python in excel. Yo do good things bro, carry on ❤! Thank you very much! Greetings from Azerbaijan, Baku!
Great stuff @Kevin I learnt so much in one evening following your videos. I've also subscribed to more videos to never miss any more of your juicy posts!
Hey kelvin, you're the only one who makes me understand things in my computer.. would you kindly tutorial on how to design a website please please please 🙏🏽🥺
Another amazing video. The describe method just changed my life. Looking to more programming videos! I am a Mechanical Engineer trying to branch out into more skills 😁
Just updated by Excel 2019 - No Python option. Kevin should really have mentioned that this may or may not be available in your specific Excel version.
Same with my companies excel 2023
Amazing! Thanks for sharing! 😀
Amazing! Great content for beginners!
Thank you so much. Looking forward to them releasing to the public so I can play with it at work.
Keep up the amazing work
I can believe it what!!!!! Python in Excel !!! !!! 🥰😍😄😆🤣😂🙂😋😛 ... I' m sooooo excited
Awesome 🎉🎉🎉 I can't spell my gratitude toward you man. You are the hero of my day.
Amazing! I learned today, love it! Looking forward to more tutorials in python using excel.. 😊
You're a hero!!!! I learned a lot from you today.
Kevin - both thumbs up! Great video, thx
Could you please use a simple machine-learning model as an example to get familiarized with the features? This is life-changing for someone who cannot code as fluent as a software engineer but understands the code and data
Gantt was best!!! Looking for more such videos.
My Excel does not show the python buttons like in your example. What do I do for it to show in the formula tab? Thank you
Same problem here.
I'm guessing you might need to use the online version of excel (?)
Sign up for beta channel. Restart the computer. Worked for me.
You need to sign up to the Microsoft insider program to have access to it
Thanks for the great intro, well done. Tim in San Diego
Great video! Looking forward for this feature to be GA
I am deaf and it would surely be amazing your posts be supported with transcripts. I really, really want to learn.
need an advanced python excel video kevin, looking forward to it ;)
Thank you for all this wonderfulness, I've opened my Excel, went to Formula, oops there is no Python. Can't understand why there is no Python, using Microsoft 365, can you explain? Thanks Kevin!
same
same
Very interesting, especially the Gantt Chart example
Definitely not robust enough for most use-cases but has potential
Thanks Kevin. Highly informative. I signed up but was placed on a waiting list with no ETA.
Kevin will show us how his python excels!
What?😂
Ayo? Which Python you talking about...😈
@@ShawnFX well Kevin would say it's more like an anaconda
@@willfungusman8666😂😂😂
Liked, subscribed. 👌
Can you explain how to activate the Python feature in Excel? What are the requirements?
It’s currently rolling out. Here’s the latest update from Microsoft on the roll out status: Python in Excel is now available to all Enterprise, Business, Education, and Family and Personal users running Beta Channel on Windows. This feature will roll out to Excel for Windows first, starting with build 16.0.16818.20000, and then to the other platforms at a later date. To get it now, you can join the Microsoft 365 beta channel directly from within Excel.
Hi Kevin, do you have a video about Microsoft Copilot?
I have Excel 2019, is it possible to use Python or is this presentation only for Excel 365? Alternatively, is there any official and safe plugin so that I can also use Python in my Excel?
it seems to be not possible, for now it will work only in 365
Man, thanks
Would have been useful if you had provided the code for the Gantt Chart. I got a different response and the data is displayed in the reverse order you have, and the date is from 40 to 90 with other scientific notation.
Can you make a video about exporting Excel infographic charts to video file, so we might include animated charts in videos.
Thanks, I want to know which version of Excel directly supports the Python functions?
Great video.
But as I see Python in Excel is not available yet. Am I wrong?
It’s currently rolling out. Here’s the latest update from Microsoft on the roll out status: Python in Excel is now available to all Enterprise, Business, Education, and Family and Personal users running Beta Channel on Windows. This feature will roll out to Excel for Windows first, starting with build 16.0.16818.20000, and then to the other platforms at a later date.
Thank best tuto
Great Video, I am not able to expand the image generated by python. I do not see the icon to expand the image.
How to install the Python libraries which are missing in the Python for Excel?
I currently use excel (VBA and analytics) for analyzing industrial data. It currently sits behind firewalls …. By running the same analysis using python.. on the cloud, how can I be assured that all our sensitive data (and analysis) is not being see/sold to competitors?
hey, can you make a video on how to up the quality of the Xbox game bar and how to download NVİDİA?
I don't see python under formula tab
Hi Kevin,
Is it possible to import private or authenticated Google sheets in excel, since Power Query in excel does not have any google sheet connector and it can only import public sheets. Do you have any workaround for this?
Also thank you fir your videos on Power Query and Power Pivot, I was able to create some automated models at work. They saved hours :)
Thanks Kevin
Amazing
Kevin, how do text TRUE and FALSE get to the formula bar?
How I get Python to Excel?
I use excel version 2016 but I can't see python in the formula Tab.
It is only for Excel 360 😞. The video author failed to disclose this important bit of info
On a project that relies on use of tables and headers. Using Python I get errors for cannot find header. I have a header in excel using a table. I selected options table has header. Why would an error be thrown when I have a header ? If you are able to let me know what to do or maybe assist me in this error.
so all the code including data you use in the python script will go to microsoft ?
i find that concerning if you handle confidential data
Hey man, Im doing some excel copying and pasting to another but when i try to paste dates it doesnt show up like "dd-mm-yyyy" its like "yyyy-mm-dd 00:00:00" any help?
How about a video on how to install Python into Excel? My Excel 2016 doesn't have it so how can I update it so the Python icon appears in the FORMULA tab.
Is the run speed any different?
why am I not able to see the python option in excel? And how do I enable that option? Kevin this time didn't cover this topic unfortunately, not usually like him!
Can someone please tell me why I can`t find the "insert Python" option in formulas? I`m using this paid version of Microsoft 365. Do I have to update anything there? Shouldn`t that be automatically always be the new version or what am I doing wrong?
Very eager to see Kevin's python today 😏😘
3:50 since when was installation a requirement for python? You could compile python to a dll and include it in excel.exe, or as an xll addin, or compile python to wasm and execute from a wasm engine [e.g. Pyodide] (either on-prem or in the browser for web excel)
Ultimately installation is absolutely not the reason I'm sure, it's because either they are stealing your data or they want to make this a subscription model where you pay for server time.
6:00 thanks for including this, most previews didn't include this critical understanding. Is there one python runtime per workbook? Or does it evaluate from the first workbook opened to the last within the same runtime?
It would be interesting to know what ActiveX implementations there is for working with python in Excel.
@@SOLDAT_MENDES This looks like a direct copy pasta from chatGPT? Microsoft could integrate Python DLL into Excel. Whether these are widely supported or not is irrelevant. And Excel isn't doing installation of python AT ALL, so idk why that is at all in this comment...
thanks for the video
surely Excel+Python is just at the beginning but, apart from some fancy chart, I don't see how this can be translated in the real world
If you have a stand alone Excel file installing Python and Jupyter notebook takes no time and little skills, there you are free to work in a much more practical way, that can be exported to Excel if needed
If instead you need to share your work with others...not so easy
A good value of this I can think of it's a way for lots of people to gradually be introduced to Python, who eventually will migrate to Python for good 🙂
Strongly disagree. Being able to easily build charts outside of the inbuilt Excel charts is a fantastic outcome on its own, as previously that required external plug-ins.
But more importantly, being able to access Python's existing libraries is huge, as it allows you to access pre-built statistical functions that aren't in Excel. In the past you would have either had to write a monstrous formula, take the data out of excel for one task, or write your own implementation in VBA as a UDF (which would require saving as a macro enabled workbook). Now you can access these functions through Python.
Manipulating and transforming data tables will also be much simpler with DataFrames and Pandas. Previously this would have required some combination of PowerQuery, array functions, intermediary calculations, VBA, and/or pivot tables.
And to your own point, being able to share your work with others is a massive benefit. Most of the corporate world still runs on Excel, despite its many faults. Being able to do any of the above and send it to someone without having to worry about them having a Python install is amazing. Anyone in sales, HR, marketing, etc can open an Excel book; good luck getting them to run Python. This definitely isn't for everyone, and using Python+Jupyter will obviously always be more powerful, but this will very much be translated to the real world.
I think this is the beginning. I have a feeling that more features will be added and we will reach a point where VBA in Excel is a thing of the past. This is fantastic for the user since Python skill is transferable. My reluctance to learn VBA is going to finally pay off!
I receive connection errors when I am trying to connect to localhost with Flowise or Local LLM APIs. In Python it's ok, but with excel it's not. Any thoughts?
show as how to download the new version of microsoft office 2023
All that would be really cool if you could run it locally, in the background and have a file structure… just make python available in the VBA editor. I can 1000x more in the editor than can be done with cells, just imagine python in editor.
this do not work at all for me. I have a PC with Windows 10 an d one with Windows 11 and both and everything is updated. None of the suggested way to start Python in Exel works. I get no Python to start in Exel in none of the PC´s. I live in Sweden. is that the cause of the problem ?
I currently use a windows machine, but am thinking about switching to a MacBook. My fear as that some significant features of excel will be missing.
Can I use python in excel Mac version ?
It is only for Excel 360 😞. This bit of info was failed to be disclosed.
hey there, i trying to figure out how to setup docusaurus by facebook. Can you make a video on how? PS. my spelling for docusaursus is not good🤣
Did you ever work with 1-2-3? Excel is so far behind. Back around 2000 using Lotus Script (built in to Lotus Suite) you had complete manipulation without having to place code into the cells. In Approach I was communicating with outside servers and populating data.
Is this still a beta version? I cannot access Python and everything I see online says you must be in the early adopter program.
what version of Excel comes with Python?
Microsoft365. Currently only available for beta testers. But I guess it won't be too long before production release.
What happens if I share this workbook with someone that does not have the feature yet?
Sharing an Excel workbook with someone who doesn't have the feature yet may limit their ability to access and edit the workbook's advanced features. It's best to ensure that all participants have the necessary features enabled for a smooth collaboration experience.
💕 from here
Is it available for ms office 2019?
You’ll need Microsoft 365. It’s currently rolling out to Microsoft 365. Here’s the latest update from Microsoft on the roll out status: Python in Excel is now available to all Enterprise, Business, Education, and Family and Personal users running Beta Channel on Windows. This feature will roll out to Excel for Windows first, starting with build 16.0.16818.20000, and then to the other platforms at a later date. To get it now, you can join the Microsoft 365 beta channel directly from within Excel.
@KevinStratvert Thanks, Kevin 😊 ! Your videos are really very much helpful!
Do I need to install some extension to get Python inside Excel? Now I don't have it
No, you don't need to install any extension to get Python inside Excel. It is now available as a built-in feature in Microsoft Office 365.
Guys, what is it version of Excel?
How to use the LET Excel function and Python, example "=PY(4+2)" ok it works. How to have the same result with "=LET(x:PY(4+2),x)"
Which Microsoft ofc version contains python?
The Microsoft Office version that contains Python is Microsoft Office 365.
I am just confused If the size of your dataset is not beyond Excel's capability, why use Python?
Kevin , could you please direct me to a FREE SIMPLE IMAGE EDITOR that will help me see objects ( cars , vehicles ) in water ? I am enjoying trying to find missing people who end up slipping into water ( ponds , rivers , streams , etc ) . . all over the country and it is very rewarding . Have downloaded a few image editors but there are too many controls with strange names I do not understand and it is an awful experience . Thank you .
Absolutely complicated.
I am not able to see the Insert Python option in the Formulas
It’s currently rolling out. Here’s the latest update from Microsoft on the roll out status: Python in Excel is now available to all Enterprise, Business, Education, and Family and Personal users running Beta Channel on Windows. This feature will roll out to Excel for Windows first, starting with build 16.0.16818.20000, and then to the other platforms at a later date. To get it now, you can join the Microsoft 365 beta channel directly from within Excel.
@@KevinStratvert Thank you for your response. But I have checked my updates in Microsoft Excel, and it is up to date, and I have not found any Join Microsoft 365 beta channel option. Can you make a separate video for that? or suggest another option. The current version of my Excel is Version 2308 Build 16.0.16731.20182
@@aashishkatyal Check out the following article: insider.microsoft365.com/en-us/join/windows
@@KevinStratvert Yes I have checked it, but in my Microsoft account Microsoft 365 Insider button is not coming
I think l am kinda bored with windows, but can you introduce Linux
Is there a way to find someone’s birthdate through outlook?
I need python in advance...
Like create a project using database or create a game for children.... Thank you
I can't access python in my excel
Love your work … but so far all examples can be done without python …. Last time I did coding was in 1999 and it was in C . I’m still trying to find a reason to learn Python
I have been experimenting a bit with this and I think for it to be truly useful you either need to have a more esoteric requirement for visualisation, or just absolutely enormous data.
There are obviously things Python can do that Excel can't. But specifically within Excel, I'm not sure what the practical applications are besides the above (which is not to say that there aren't any applications at all - just that a notebook might be a better environment for those things).
I also haven’t been able to find a way to actually get external data using this - still dependent on Power Query or other existing connectors.
One good thing is that you can read directly from queries without loading them to a worksheet, so you could potentially work with larger datasets that way. Not sure how performance compares to just using Power Pivot in that scenario, though.
All of this is probably going to be moot for me anyway since it seems Microsoft will charge a subscription to use Python in Excel when it reaches gold.
Am I the only one who's unable to see some of the data because of the caption? I don't see the option to turn it off.
My bad! Will make sure to position the screen so it doesn't interfere with the captions in the future. You can turn captions on/off with the CC icon.
Let us try Java script
Why are non of you UA-cam content creators mentioning The Insider Program?
Why this video is dubbed in spanish?
There is absolutely no scenario where running the interpreter on MSFT servers is a good thing for the user. It just gives the company control over the user and is nightmare for privacy. Besides, not everybody is always connected to internet and, for me who lives in Africa where data is prohibitively expensive, the cost of internet connection will add up.
Twins
Guys, what is it
First
Nobody cares
@@JB_inks ok
NO INFORMATION FOR MULTIPLE PAGES FILES OR BOOK. ONLY BASIC INFORMATION HAS BEEN GIVEN.
This is for 365 i guess
Cool!💯