Hands-on ChatGPT in Excel (Book)

Excel is a suprisingly simple and effective tool to create solutions that make use of Generative AI.

In this book you will learn everything you need to know to create your own AI-infused Excel tools:

  1. How to use the new LABS.GENERATIVEAI Excel function,
  2. How to prompt ChatGPT to get results you can work with in Excel, and
  3. How to use a hand full of other Excel functions to create prompts and work with completions.

You can buy this book on Amazon.

You can also buy my course ChatGPT for Excel Users which covers the same topics.


Here are the Excel workbooks referenced in the book. You can download them individually or as a single zip archive.

Getting Started and Creating Prompts with Excel Formulas

Download LinkDescription
chatgpt-capabilities.xlsxA framework to think about ChatGPT’s capabilities. Main point: ChatGPT is not only about creative writing.
concatenating-text.xlsxShows how to create prompts for ChatGPT in Excel with text concatenation.
converting-numbers-to-text.xlsxShows how to convert numbers, dates, and times to a format that you can use in ChatGPT prompts.
joined-lists.xlsxHow to join lists in Excel so that the data can be used in ChatGPT prompts.
markdown.xlsxDemonstrates joining tabular cell ranges into a CSV table that ChatGPT can understand. ChatGPT converts Excel tables to Markdown tables.
largest-capital.xlsxDemonstrates joining tabular cell ranges into a single CSV String with the TEXTJOIN Function. In this example, the data is added to the prompt that asks ChatGPT to select the largest capital in terms of population relative to the country’s population.
text-topic-verification-tool.xlsxA workbook prepared for the lab about Text Topic Verification. The task is to convert a prompt template into a valid Excel formula. The tool can check if a text is about a given topic. This works even if the word for the topic is not mentioned in the text.
text-topic-verification-tool-solution.xlsxA solution for the Text Topic Verification lab.

Basic Prompt Engineering Techniques for Excel

Download LinkDescription
concrete-and-water-density.xlsxPrompting ChatGPT to generate Numbers for Excel.
days-since-man-on-moon.xlsxPrompting ChatGPT to generate dates for Excel.
time-extraction.xlsxPrompting ChatGPT to generate times for Excel.
cities-list.xlsxPrompting ChatGPT to generate lists for Excel.
fruits-table.xlsxPrompting ChatGPT to generate tables for Excel.
date-transformer.xlsxA workbook prepared for the lab about date transformation.
date-transformer-solution.xlsxA solution for the lab about date transformation.
sentence-generator.xlsxA workbook prepared for the lab about sentence generation.
sentence-generator-solution.xlsxA solution for the lab about sentence generation.
sentence-generator-solution-improved.xlsxAn improved solution for the lab about sentence generation.

Adding Logic to Prompt Flows in Excel

Download LinkDescription
prompt-preparator.xlsxDemonstrates letting the user decide what to do next by asking the user to decide if the app should start prompting.
logical-functions.xlsxShows the effect of the XOR, AND, and OR functions on four variants of input values as well as the result of the NOT function on the result of the OR function.
comparison-operators.xlsxShows the effect of the six comparison operators on three variants of input values.
combo-compass.xlsxDemonstrates the use of logical functions and the IF functions to let Excel decide what to do next.
grammar-genie.xlsxDemonstrates the use of a ChatGPT result in the condition of an Excel IF function.
dreamfit.xlsxDemonstrates the use of lookup tables together with the XLOOKUP function to look up parts of a prompt for ChatGPT.
opti-response.xlsxDemonstrates a parallel prompt flow in Excel. The workbook contains an input cell for customer feedback and a list of products. The workbook uses parallel prompt flows to infer the sentiment and the product mentioned in the feedback. Then, it uses the results to generate a positive response.
context-check.xlsxDemonstrates that LABS.GENERATIVEAI only forwards information to ChatGPT that you provide via the prompt attribute. It does not keep context information on its own.
chatsheet.xlsxDemonstrates how to build a chat sheet in Excel.
tablejoin-function.xlsxAn Excel workbook that contains the TABLEJOIN Excel LAMBDA function and an example how to use it. You can use the TABLEJOIN function to join tabular cell ranges into a CSV table with a single function call.
data-dynamo.xlsxContains an Excel LAMBDA function for creating example data with the help of ChatGPT.
slogan-sheet.xlsxA workbook prepared for the lab about creating Slogan Sheet. This can help you come up with and evaluate creative slogan ideas and is an example of a multi-step prompt flow in Excel.
slogan-sheet-solution.xlsxA solution for the Slogan Sheet lab.

Advanced Prompt Engineering Techniques for Excel

Download LinkDescription
number-extraction.xlsxDemonstrates few-shot prompting with Excel and ChatGPT by extracting numbers from text.
sentiment-classification-few-shot.xlsxDemonstrates few-shot prompting with Excel and ChatGPT by classifying the sentiment of a text.
sentiment-classification-zero-shot.xlsxShows that ChatGPT can classify the sentiment of a text with zero-shot prompting, too.
reasoning-extraction-with-cot.xlsxDemonstrates chain-of-thought prompting for improved reasoning capabilities. ChatGPT solves a text challege. The resulting number is extracted with a second prompt. I found this example in the paper When do you need Chain-of-Thought Prompting for ChatGPT? by Chen et al, 2023. I used it as it nicely compares chain-of-thought with zero shot reasoning.
reasoning-extraction-without-cot.xlsxDemonstrates that ChatGPT can solve the challenge also without chain-of-thought prompting. This shows that you do not always need to add the magic “let’s think step by step” phrase to your prompts to get good results.
are-you-open.xlsxDemonstrates retrieval augmented generation (RAG) with Excel and ChatGPT.
simupy.xlsxDemonstrates the “acting” prompt engineering technique by letting ChatGPT act as a Python interpreter. With this, you get a simulated Python interpreter in Excel.
flash-function.xlsxA workbook prepared for the lab about creating FLASH - a ChatGPT powered flash fill implemented as an Excel LAMBDA function.
flash-function-solution.xlsxA solution for the FLASH lab.

Your Feedback

If you find errors or have other feedback, please let me know: You can reach out to me via Email, Twitter or LinkedIn.

This post is licensed under CC BY 4.0 by the author.