Giter Site home page Giter Site logo

jddev273 / chatgpt-excel-functions Goto Github PK

View Code? Open in Web Editor NEW
37.0 1.0 4.0 1.7 MB

Excel Functions allowing you to use ChatGTP within Excel through the ChatGTP API.

License: MIT License

VBA 100.00%
chatgpt excel function gpt-3 macros microsoft ms openai

chatgpt-excel-functions's Introduction

ChatGPT Excel Functions

A set of functions for communicating with the OpenAI ChatGPT API in Microsoft Excel and perform various taasks. This was tested under the latest version of Microsoft Excel. Adjustments may be needed to run with older versions.

Update 3/10/2023

Added ChatGPTSummarize() function. Writes a short summary paragraph about the data in a selection of cells. ChatGPTSummarize Video (https://www.youtube.com/watch?v=i9MPDIbnErI)

Added ChatGPTQuerySelection() function. Allows you to ask query ChatGPT about the data in a selection of cells.

ChatGPTQuerySelection Video (https://www.youtube.com/watch?v=VrmhIFKKYBA)

Update (3/9/2023)

Added a ChatGPTList() function. Pass in something you want a list of like in the video below, you can have the list output vertically and horizontally.

ChatGPTList demo:

ChatGPTList Video (https://www.youtube.com/watch?v=bLxEHdxFb9k)

Update (3/8/2023)

Added a ChatGPTQuickFill() function, you pass in the number of cells you want to look backward for on the fill (if the cells don't exist or are empty they are ignored). No prompt engineering required, the prompt is engineered automatically.

Here's a demo video of the new Quick Fill:

ChatGPT Quick Fill Video (https://www.youtube.com/watch?v=t9rUA67DV0E)

Demo

ChatGPT In Excel Demo

Installation

These instructions may only apply to recent versions of Microsoft Windows. You will need:

  1. Open Microsoft Excel and click on the "Developer" tab.
  2. Click on the "Visual Basic" button.
  3. In the "Microsoft Visual Basic for Applications" window, click on "Insert" and then "Module".
  4. Replace the existing code with the code in the "chatgpt-excel-function.vba" file.
  5. Replace sk-YOUR-CHATGPT-KEY-HERE with your own OpenAI API key.

Usage

Prompt chatGPT in a cell by typing =ChatGPT(prompt), where prompt is the text you want to send to the ChatGPT API.

Quick fill cells using ChatGPT without a prompt using =ChatGPTQuickFill(optional titleCell, optional contextCell) where title row and context row default to row 1, and column a. A prompt will be automatically generated.

Insert lists with ChatGPT using =ChatGPTList(topic, optional horizontal) The list will be created based on the passed in topic, by default the list will be placed vertically.

Query cells with ChatGPT Using =ChatGPTQuerySelection(query, selection, optional isheader) This allows you query a selection of cells, you can set isHeader to true and it will use the first row as topic headers. Currently this uses JSON, but that may change or have another option because of higher token count. ChatGPT though seems to work best with JSON data rather than other formats tested.

Summarize cells with ChatGPTUsing =ChatGPTSummarizeSelection(selection, optional isheader) This allows you to summarize a selection of cells. Set isHeader true to use the first row to identify variable in the JSON that is passed to ChatGPT.

Troubleshooting

If you receive an error related to WinHttp.WinHttpRequest.5.1, it means that the WinHttp library is not registered on your computer. To resolve this issue, you can try re-registering the library by running the following command in an elevated command prompt:

regsvr32 %systemroot%\system32\winhttp.dll

If the error persists, you may need to reinstall the library. You can download it from the Microsoft website.

Note

The UnescapeString function is used to format the response from the API into a human-readable format. If you encounter any errors or unexpected output, please refer to the comments in the code for further assistance.

Disclaimer

The authors and contributors of this program provide it as-is, without any warranties or guarantees. They cannot be held responsible for any damages resulting from the use of this program.

License

This program is licensed under the MIT license.

Author

Johann Dowa

chatgpt-excel-functions's People

Contributors

jddev273 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

chatgpt-excel-functions's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.