I Added Google Gemini to Excel… And It Blew My Mind 🤯

I Added Google Gemini to Excel… And It Blew My Mind 🤯

Machine-readable: Markdown · JSON API · Site index

Поделиться Telegram VK Бот
Транскрипт Скачать .md
Анализ с AI

Оглавление (3 сегментов)

Segment 1 (00:00 - 05:00)

I built a free solution that brings Gemini right into Excel. This can be helpful if you want to analyze your Excel data with the help of AI. And no worries, you don't need to know any code of this. It is pretty much a plug-and-play solution and I will walk you through everything step by step. So this solution supports the latest Gemini models and also Google has a free tier. So that means for you, you can get started at no cost. The only thing you need is Windows and the desktop version of Excel because we are using VBA macros here. Alright and later in the video, I will also show you how to use local open source models instead of Gemini. That way, you don't have to pay for anything and your data stays on your computer. But as I said, more on that later in the video. So without further ado, let us dive in. Okay so there are two ways on how to use Gemini in Excel. The first one is that you select a range and then ask your question or alternatively you can also use the Ask Gemini formula which I will also show you in just a second. But let us start with the first example where I want to do some sales analysis. So I will just select my range here, click this button and then I can ask my prompt. For example, analyze my sales, answer in one sentence and let's be polite here, please. Alright and once you click OK, this data will be now sent to Gemini and you will get the result right here in a new sheet and you can see the sales summary from Gemini in this cell here. Alright and with that, let us also have a look at another example. For example, let's pick this one here where I want to extract the first names from my email addresses. So once again, I will select the range, click this button and then I will ask Gemini to extract the first names. Alright, once again, I click OK and then it will reuse my worksheet here and I've got back the name. So we've got John, Jane, Bob and Alice and we can also check this. So John, Jane, Bob and Alice. Alright and next up, let me also show you the Ask Gemini formula. So here on the left, I've got my prompt and then right next to it, I've got a new Excel formula which is Ask Gemini. So let me activate it and then run the cell. So my prompt is what is 2 + 2 and yeah, the result is 4. Alright and since this is just a normal Excel formula, you can also just drag it down to get the answers for my other prompts. So the capital of France is Paris and also translate hello to Spanish, that would be Hola. Alright and lastly, also it's written here in the example form, if you want, you can also ask AI without selecting any cell. So if you've got an empty cell here, you just click this button and then you can ask a prompt, for example, tell me a joke and when you press enter, you will also get the result in this sheet here. So the joke is why don't scientists trust atoms, because they make up everything. Yeah, okay. The joke could be better but anyways, if you want to install Gemini into your spreadsheet, then let me show you how that works. And it's actually fairly easy because I have done already all the hard work for you. You just need to go to my GitHub repository and I will, of course, also leave the link to this repository in the description box below. So once you're here, you want to click on this green button here and then download the whole code as a zip folder. Alright, so once that is done, I can go to my downloads folder and here we first need to extract it. So let me right click on it, extract all and then click here on extract and we've got a new folder with the workbook and also all the source modules, which I will also show you in just a second. But first, let me actually close my other workbook here because we've got the same name. So let me close this one here. No, I don't want to save it. And then we could open this workbook here. But before we do this, you need to know that sometimes Microsoft blocks files downloaded from the internet. So first, we need to make sure to unblock this file and you can do this by just right clicking on here, going to properties and then in the security section, you might see an option that says unblock. So just tick the box here, hit apply and then OK. Now and if you don't see the unblock option, that just means the file is already unblocked. So you're good to go. Alright, and with that, let me open the spreadsheet. Now here you will notice this is already in Maco enabled workbook because it already contains all the code we need to ask Gemini. And to view the code, you just need to go to the developer tab and then go to the visual basic editor. Now, if you don't see the developer tab, just right click somewhere here and then choose customize a ribbon. Now in the new window, you want to tick the box next to developer like so and then click on OK. So now you should also see the developer tab. And from here, just click on visual basic to open the visual basic editor. All right. And in here you will find a couple of modules and also a class module. So we've got the JSON converter. We've got the Gemini module, the Gemini demo module and also the dictionary class. Now the main code is all written here in the Gemini module, which you can see here. And if you scroll down a little bit, you will find here a configuration section. So if you don't want to mess with any code, this is the place where you need to do some adjustments because after that, so after the configuration section here, you will see the

Segment 2 (05:00 - 10:00)

actual code on how to run Gemini into Excel. And this code here now also uses the helper modules like the JSON converter and also the dictionary class. So to use this module, once again, you need the JSON converter as well and also the dictionary class. However, there's one optional module, which is the Gemini demo. So this one is really just to create a demo sheet in your current workbook with some practical examples. So that means you don't have to use this module. It is really just there for demo purposes. All right. And with that said, let us now go back to the configuration section. Now here you will see a lot of options, but the most important one is your API key. So you need to get an API key from Google. And to do that, just navigate to this website here. Now if you don't have an account yet for Google AI Studio, you will need to create an account. But once you are logged in, you should see this section here. And here you just need to click on create a key and then you can give it a name. For example, test. And then afterwards, you also need to select a cloud project. Now in my case, I've already set up a project, which is called Excel. But in your case, if you don't have a project yet, you just create one and then follow the instructions from Google. So I will select mine here, which is Excel, and then I will create my key. Once that is done, I can copy it to my clipboard, like so, and then return back to Excel. And then you want to paste that API key right in here. Now of course, I will also delete my key before uploading the video, so please don't try to use my key here. All right. And with that, you could also now tweak the other options here. For example, you can assign which model you want to use. I think in most cases, the Gemini 2. 5 flash and the light models are totally fine. But if you wanted to, you could also use the latest one. So at the time of this recording, that would be Gemini 3. All right. And if you also scroll down a little bit further, you will see a couple of more settings you can tweak. However, I will not explain all the details here, because as you can see, I have written all the comments here. So just have a look and adjust the settings to your liking. All right. So now that we have our API key, let us actually test it out right inside Excel. So for that, I will just click this button here, and then we can ask again a prompt, for example, Tami and Excel related joke, and then press OK. So now ideally, we should also get a new worksheet here. And inside, we will now find our joke. So why did the Excel file break up with the CSV file? Because they couldn't "cell" the differences. All right. So now that you know it's working, let us actually take it one step further and execute our Gemini code from all our spreadsheets, because right now it will only work inside our demo workbook. So to run our Gemini code in all our spreadsheet, we will need to save our VBA code into our personal workbook. Now to create this personal workbook, you just want to click on the macro recorder. So just click here. And then here, it's important that you select personal macro workbook, because I think by default it will be this workbook. So you need to change it to the personal macro workbook. So once that is selected, just click on OK. And then you can immediately stop the recording by clicking on here. All right. And with that, we can now go back to the Visual Basic Editor. And now you will find your personal workbook down here. Here you will now find a new module with the macro one we just recorded. But most importantly now, we can copy all our code from our demo workbook into this personal workbook. And for that, you just select the module and then just drag it into your personal workbook like so. So I will do it for the JSON converter, the Gemini module, and also the Gemini demo, and also the dictionary class. All right. So now let me go ahead and test it out. For that, let me close the demo workbook. And here you don't need to save the demo workbook. That is fine. However, you do want to make sure to save the personal macro workbook. So here, when you see this prompt here, definitely make sure to click on Save. All right. Now to test it out, let me quickly create a new spreadsheet here and then open this workbook. And in here, we could now create a new button in the Quick Access Toolbar, which will then execute our Gemini code. So to do that, I will just click on here and then customize the Access Toolbar by going here to More Commands. And in here, in this dropdown, you want to select the macros. And in here, you should now find the macros we just copied. So we've got our main subroutine, which is Gemini. So I will just select it here and add it to my Quick Access Toolbar. And optionally, you can also import the demo module. So let me do this by selecting it also and adding it here to my Quick Access Toolbar. All right. And also optionally, you can modify the icon. So just select the module, then click on Modify, and then you can pick anything. So I will take maybe this guy here, click OK. And for the demo, let's pick the yellow color. Why not? All right. And with that, just click on OK. Now to see if it works, let me click on the yellow color here now. And now we've got our example demo sheet here. And from here, we can now run the same test. So that means I will just select all my range here and then click on this person icon here.

Segment 3 (10:00 - 12:00)

And I can ask my question. For example, once again, I can say, analyze my sales, answer in one sentence. All right. And as you can see, we've also got our new sheet here with the answer from Gemini. All right. And with that, let us also check out if the formula is working. So if I remove the leading apostrophe here, we will get a name error. And that is because you also need to specify where this Ask Gemini formula is now located. And in our case, it will be in our personal XLSB workbook. And here you want to have the exclamation mark afterwards. And now when you press Enter, it should work. So we've got the same result. So 2 + 2 is still 4, which is good. And then we can also drag it down. All right. And that is how you can integrate Gemini right into Excel. Now, as you have seen, the VBA code is freely accessible. So if you want, you can also tweak it and adjust it to your needs and liking. Now just keep in mind two things. So first of all, yes, Google has a free tier. But at some point, depending on how many API requests you're doing, you also need to pay money to Google. And the second thing is, this is, of course, not a private solution. So depending on how sensitive your data is, just be aware that you are sending this data to the Google servers. So for those reasons, I also want to show you an alternative solution, which is called XLlama. So XLlama is an Excel-it-in that I have created that lets you run open source models right inside Excel. And this obviously has the benefit that you don't have to pay for any API calls. And most importantly, it's a private solution. So none of your data ever leaves your computer. So to show you how that works, let me replace the Gemini formula with the XLlama formula. And then I will just link my cell here and press Enter. And just like before, we will now get the result right here in Excel. And again, this is just a normal Excel formula. So I can just simply drag it down to apply to all my other cells here. So now instead of using Gemini, I'm using a free open source model that runs locally on my machine. So currently, if I go to my settings, you can see that I'm using the qwen3 model. But if you want, you could also pick other models like DeepSeekR1 or Gemma or even install more models. That is all possible with XLlama. And like before, you could also analyze an entire range. So for that, you just select your range and then just click the Run XLlama button. And like before, here you can now input your prompt. For example, extract the key insights from my data in one sentence. No preamble. And once again, if you press Enter, you will get back the result in a new worksheet. So if you also want to check out XLlama, I will leave the link also in the description box below. Just note, this is not a free add-in. It's a pay plug-in, but it's a one-time purchase. So basically, you just buy it once and then you can use it forever. All right. And as I said, I will leave all the links in the description box down below. And if you've got any questions, just let me know in the comments box below. And with that, thanks for watching and I will see you in the next video.

Другие видео автора — Coding Is Fun

Ctrl+V

Экстракт Знаний в Telegram

Экстракты и дистилляты из лучших YouTube-каналов — сразу после публикации.

Подписаться

Дайджест Экстрактов

Лучшие методички за неделю — каждый понедельник