0% found this document useful (1 vote)
151 views

Excel + ChatGPT For Data Analysis

Uploaded by

Samy El Zwahry
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
151 views

Excel + ChatGPT For Data Analysis

Uploaded by

Samy El Zwahry
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

Excel + ChatGPT

DATA ANALYSIS POWER TIPS

*Copyright Maven Analytics, LLC


COURSE OUTLINE

Explore how AI is changing the way data analysts work, and


1 Why Analysts Need to Use AI why leveraging these tools is critical to stay competitive

Introduce the AI landscape and the role of large language


2 Intro to AI, LLMs & GPTs models and generative pre-trained transformers like ChatGPT

Review best practices for creating clear and effective prompts


3 Prompt Engineering Tips when working with tools like ChatGPT or Bard

Explore some of the most powerful and practical ChatGPT use


4 Microsoft Excel Use Cases cases for data analysis with Microsoft Excel

*Copyright Maven Analytics, LLC


MEET YOUR INSTRUCTORS

CHRIS DUTTON
Chris is an EdTech entrepreneur and best-selling instructor.
As Founder and Chief Product Officer at Maven Analytics, his
work has been featured by USA Today, Business Insider,
Entrepreneur and the New York Times, reaching more than
1,000,000 students around the world.

✔ Certified Excel & Power BI Expert


✔ Founder & Lead Instructor

*Copyright Maven Analytics, LLC


SETTING EXPECTATIONS

This is an overview on how data professionals can use AI tools


• We’ll introduce the AI landscape and tools like ChatGPT, and review practical use cases for data analysts,
but will not dive deeply into how these models work or give an exhaustive list of everything they can do

We’ll be using free AI tools for the course demos


• We’ll quickly touch on paid options and alternative tools, but the majority of what you see in this course will
be shown using the free versions of ChatGPT and/or Google Bard

AI is a rapidly evolving field, and these tools will change quickly


• AI technology is moving FAST, which means that existing products will change, and new vendors and tools
will emerge, but the core concepts and best practices you learn in this course will remain relevant

This course is designed be modular to fit your needs


• The first half of the course is for everyone, but the second half is structured so that you can focus specifically
on the tools you use as an analyst – feel free to skip over the tool sections that don’t apply to you!

*Copyright Maven Analytics, LLC


WHY ANALYSTS NEED TO USE AI

*Copyright Maven Analytics, LLC


WHY YOU NEED TO USE AI TOOLS

THE WORLD IS CHANGING


Technology like ChatGPT, Google Bard, and other Artificial Intelligence tools allow you to
complete tasks that used to take hours in a matter of minutes, making it a total game changer

Reasons you should learn to use AI tools:


✓ Improve your performance & efficiency
✓ Automate routine, low-value tasks
✓ Spend more time on the higher value activities
✓ Use AI as an easy way to check your work
✓ Leverage it for learning and answering quick questions
✓ Stay on the cutting edge and competitive in your field

*Copyright Maven Analytics, LLC


ARE DATA ANALYST JOBS AT RISK?

AI WILL NOT REPLACE YOU


Fears of analysts losing jobs to AI are overblown; companies will always need human talent and
intuition, but the skills required to be an effective analyst will shift substantially

We call this the “Analytics Trifecta”, because it represents the


STRATEGIC three core skills that separate a good analyst from a great one
THINKING These are uniquely
This is where AI “human” skills Since AI can fill many technical gaps, analysts with exceptional
really adds value
strategic thinking and communication skills will become more
valuable than ever to organizations

Combine those “human” skills with a strong technical


TECHNICAL COMMUNICATION foundation enhanced by AI, and you’ll be unstoppable 💪
PROFICIENCY SKILLS

*Copyright Maven Analytics, LLC


YOU NEED AI TO STAY COMPETITIVE

IF YOU DON’T USE AI SOMEONE ELSE WILL


Imagine being a data analyst today without learning spreadsheets or using the internet. We’ll
likely be saying the same thing about ChatGPT and other AI tools in the near future.

750M+ 5B+ 1B+


users worldwide users worldwide users worldwide

The key to an enduring, successful career in Data Analytics is to build a strong foundational skill
set, and keep it sharp by embracing and adapting to modern technology

*Copyright Maven Analytics, LLC


COMMON ANALYTICS USE CASES

THIS IS WHERE AI SHINES


While there are many potential ways that data professionals can leverage AI, these are a few of
the most common and powerful use cases we’ve explored:

Generating code Explaining technical Troubleshooting or Commenting Optimizing queries


or formulas concepts debugging code or formulas

Generating step-by- Providing data Automating Researching Generating


step tutorials visualization tips manual tasks technical topics data samples

*Copyright Maven Analytics, LLC


INTRO TO AI, LLMS & CHATGPT

*Copyright Maven Analytics, LLC


THE AI LANDSCAPE

ARTIFICIAL INTELLIGENCE “Weak” vs. “Strong” Artificial Intelligence


Machines and computer systems that mimic
functions associated with human intelligence
like decision making, image recognition, etc.
Weak AI (current state)
• Can only perform specialized tasks
MACHINE LEARNING • For example, GPT-4 could tell you how to drive a car,
Statistical models that help computers learn
but couldn’t use that knowledge to drive a car itself
with minimal human instruction, and get more
accurate when exposed to more data
Strong AI (Artificial General Intelligence)
• Can learn and perform any task that a human can do
• Its development is still on the horizon
DEEP LEARNING
Complex algorithms designed to
mimic the human brain and
learn almost exclusively without While Deep Learning has its foundations in Statistics, it focuses
human intervention solely on producing accurate model outputs (not understanding
Large language models (LLMs) the underlying data or relationships)
fall in this category
These models are often called “black boxes” since they can pick up
nuances in the data that humans can’t understand or detect

*Copyright Maven Analytics, LLC


GENERATIVE AI & LLMs

Generative AI systems are deep learning models capable of generating original text, images and
other types of media in response to user prompts
• Large Language Models (LLMs) are generative AI models focused on producing text outputs specifically
• Other generative AI models include DALL-E and Midjourney, which are used to generate images

A “simple” language model: How does the model fill in the blank?
• The model doesn’t know that “Paris” is the correct response, but suggests
The capital of France is
the answer it thinks is most probable in the given context
___
• Put simply, it compared “Paris” with thousands of words and determined
The capital of France is Paris. that it had the strongest relationship with words like “capital” and “France”

• This may seem easy, but remember that the word “capital” has multiple
meanings, that France has had other capitals, and that the blank could also
be things like “beautiful”, “a popular tourist destination”, etc.

*Copyright Maven Analytics, LLC


GENERATIVE AI & LLMs

Generative AI systems are deep learning models capable of generating original text, images and
other types of media in response to user prompts
• Large Language Models (LLMs) are generative AI models focused on producing text outputs specifically
• Other generative AI models include DALL-E and Midjourney, which are used to generate images

A large language model: How does the model answer the question?
1. It looks at millions of documents for similar questions and related
When did Paris become
statements like “in 508 A.D., Paris became the capital of France”
the capital of France?
2. It is then associates the prompt with these documents, and does its best
to mimic the language from the responses
Paris became the capital of
France in the 6th century. 3. Since it has an element of randomness to account for its uncertainty, if
you ask it again it will likely tell you something similar but not identical

Large language models like ChatGPT are COLOSSAL achievements in machine learning that model the “shape” of language

*Copyright Maven Analytics, LLC


GENERATIVE PRE-TRAINED TRANSFORMERS

Generative Pre-Trained Transformers (GPTs) are a type of large language model trained on
massive text datasets, and are designed to generate outputs that mimic human-written text

GENERATIVE PRE-TRAINED TRANSFORMERS


The model generates new and The model was already trained A type of deep learning model
original natural language text, on a large dataset before that can process sequential
instead of copying and pasting being fine-tuned to perform inputs and differentiate the
existing data specific tasks importance of individual parts
(also known as self-attention)

LLMs like ChatGPT are among the most sophisticated deep learning models ever built; GPT-4, which powers premium
versions of ChatGPT, has over 1 TRILLION parameters, cost over $100 million dollars, and took 11 months to train

*Copyright Maven Analytics, LLC


A BRIEF HISTORY OF AI

AI tools like ChatGPT became widely popular in late 2022, but owe their success to more than
60 years of research and development in artificial intelligence systems
GPT4
GPT3
MODEL PARAMETERS

GPT2

GPT1

“Modern Era” of AI

The term “Artificial Intelligence” Researchers find major flaws The first neural network Transformer Layers are
Deep Blue beats
is used for the first time in the Perceptron algorithm with deep learning introduced in Neural Nets
chess champion
capabilities is developed
Gary Kasparov
The first neural network Multi-layer Perceptrons & Open AI founded, AlphaGo
algorithm is implemented Backpropagation implemented IBM Watson beats beats world champions at Go
in the same algorithm humans at Jeopardy!
ELIZA, the first chatbot, Siri & Alexa
is created at MIT Neural networks outperform other AlexNet sets a standard are launched
solutions in document recognition for image recognition
*Neural Net breakthroughs
*AI achievements *Copyright Maven Analytics, LLC
PATH TO 1 MILLION

The rate of adoption for modern AI tools is unprecedented; ChatGPT became the fastest-
growing online product in history, reaching 1 million users in only 5 days

3.5 YEARS

2 YEARS

10 MONTHS

2.5 MONTHS

5 DAYS

*Copyright Maven Analytics, LLC


COMMON AI TOOLS

Rapid advancements in AI technology and the success of ChatGPT have led to an unprecedented
explosion of new apps, services, and players in the field

Text Video

Image Code

Speech 3D Music

*Copyright Maven Analytics, LLC


CHATGPT & BARD

In this course, we’ll be focusing on exploring two of the most popular GPT tools on the market:
ChatGPT (from OpenAI) and Bard (from Google)
• ChatGPT made headlines first, but Google Bard emerged as a strong competitor in early 2023

These tools each have unique strengths, but are very similar in terms of benefits & limitations for data professionals

*Copyright Maven Analytics, LLC


WARNING: COMMON PITFALLS

LLMs are known to “hallucinate” facts with total confidence


• Remember that YOU are ultimately responsible for verifying the accuracy of model outputs

Solutions provided may be suboptimal or entirely incorrect


• AI tools don’t guarantee accuracy, and may provide incorrect or inefficient solutions

These tools are broad and often lack specific domain knowledge
• LLMs may not understand specific business context or the “why” behind the responses they produce

LLMs are NOT capable of common sense or human judgement


• Models need specific, objective inputs, and may miss critical context that may seem obvious to humans

*Copyright Maven Analytics, LLC


ACCESSING CHATGPT

You can access ChatGPT for free at chat.openai.com

• Open AI currently allows anyone to sign up and use


ChatGPT for free (note that there is a paid version as well)

• You can create an account using an email address, or by


connecting an existing Microsoft or Google account

• Read more information about ChatGPT on the OpenAI


website: https://openai.com/blog/chatgpt

*Copyright Maven Analytics, LLC


ACCESSING GOOGLE BARD

You can access Google Bard for free at bard.google.com

• Google made Bard available for free in May


2023 (available in most countries)

• You can sign up for Bard using an existing


Google email or creating a new account

• Read more information about Bard here:


https://bard.google.com/faq

*Copyright Maven Analytics, LLC


PROMPT ENGINEERING

*Copyright Maven Analytics, LLC


PROMPT ENGINEERING 101

Prompts are questions or instructions that serve as the input for models like ChatGPT
• Prompt engineering is the practice of constructing prompts to generate effective and accurate responses

This is the
prompt Tips & Best Practices:

✓ Be as clear and specific as possible

This is the ✓ Provide context and examples


response
✓ Establish roles for specific use cases
✓ Set the tone or level of complexity
✓ Understand model limitations

PRO TIP: You likely won’t nail the “perfect”


prompt right away; make sure to refine and iterate
based on quality of the responses

*Copyright Maven Analytics, LLC


TIP: BE CLEAR & SPECIFIC

ORIGINAL PROMPT vs BETTER PROMPT


Can you give me an Excel formula to calculate year over year
How do you calculate year over year growth?
growth?
Data for this year lives in cells C2:C100, and data for last
year lives in cells B2:100.

PRO TIP: When generating code, include details like


variable names, data types, cell ranges, etc.

*Copyright Maven Analytics, LLC


TIP: PROVIDE CONTEXT

ORIGINAL PROMPT vs BETTER PROMPT


I’m a Data Analyst working on supply chain analytics for a
What are common supply chain KPIs?
multinational distribution company. What KPIs should I be
analyzing? For each metric, please include a formula
showing how it is calculated.
For example, we would calculate conversion rate as follows:
Conversion rate = website orders / website sessions

*Copyright Maven Analytics, LLC


TIP: ESTABLISH ROLES

ORIGINAL PROMPT vs BETTER PROMPT


I'm a new Data Analyst for a retail business, and I've been
What’s the best way to clean data?
tasked with cleaning and preparing a raw dataset for analysis.
Please play the role of a Data QA Engineer and provide a
step-by-step plan for me to follow.

*Copyright Maven Analytics, LLC


TIP: SET THE TONE

ORIGINAL PROMPT vs BETTER PROMPT


Explain regression analysis in two sentences to a C-Level
Explain regression analysis
executive at a marketing agency

PRO TIP: Use prompts like “explain it to me as if you


were speaking to a child” to adjust the tone and
complexity of the response

*Copyright Maven Analytics, LLC


CHATGPT FOR EXCEL

*Copyright Maven Analytics, LLC


CHATGPT FOR EXCEL

In this section we’ll explore common use cases for ChatGPT + Excel, including
generating formulas, troubleshooting errors, explaining complex topics, and more

TOPICS WE’LL COVER: GOALS FOR THIS SECTION:


• Learn how to use ChatGPT as a personal tutor, to
Explaining Formulas Generating Formulas explain complex Excel formulas or concepts
• Use ChatGPT to generate Excel formulas based on
Create DAX or M Code Generating VBA Scripts text descriptions or sample data
• Generate DAX, M or VBA code for data modeling,
Inputting Sample Data Troubleshooting Errors
analysis or automation

• Troubleshoot broken formulas or code

Data Prep & EDA Generating Sample Data • Provide step-by-step plans for data prep, QA or
exploratory analysis

*Copyright Maven Analytics, LLC


Explain Excel Formulas & Concepts
Please explain how the XLOOKUP function works in Excel. Describe it like you
were speaking to a child, and please provide sample data and example formulas.
PROMPT
ENGINEERING

✓ Be as clear and specific as possible

✓ Use prompts to set the desired tone and


complexity of the response

✓ Ask for sample data, formula syntax,


common use cases, etc.

✓ Iterate and use follow-up prompts until you


get the focus and level of detail you need
Generate Formulas from Descriptions
I’m managing my grocery list in Excel, with items in cells B4:B50. Please write
a dynamic array to count the number of unique text values in the list.
PROMPT
ENGINEERING

✓ Include details like table names and cell


references to generate formulas that don’t
require additional modification

✓ Provide additional context or background


information whenever possible

✓ Regenerate the responses to test and


compare options (ChatGPT may not
provide the optimal solution)
Generate DAX Measures
I have a table in Excel’s data model named “Movies”, containing fields for
Genre, Rating, and IMDb Score. Can you please create a DAX measure to
calculate the average IMDb Score for PG-13 rated action movies?
PROMPT
ENGINEERING

✓ Include details like table and field names


to generate formulas that don’t require
additional modification

✓ Provide additional context or background


information whenever possible

✓ If needed, provide a sample and ask


ChatGPT to modify it rather than
generating new code from scratch
Generate M Code
Can you please modify the following M code to add a step calculating average
IMDb rating grouped by genre and rating? [insert code sample]
PROMPT
ENGINEERING

✓ Include details like table and field names


to generate formulas that don’t require
additional modification

✓ Provide additional context or background


information whenever possible

✓ If needed, provide a sample and ask


ChatGPT to modify it rather than
generating new code from scratch
Automate Tasks with VBA
I have an Excel worksheet named "Top Movies" containing a table with the
following fields: Titles, Genre, Country, Rating, IMDb Score, and Gross Revenue.
Please generate a VBA script to autofit all rows and columns in the sheet, PROMPT
highlight every other row, and save it to my desktop as a PDF. Please provide ENGINEERING
step-by-step instructions.

✓ Be as clear and specific as possible

✓ Provide details like tables, field names and


file paths to generate code that doesn’t
require additional modification

✓ Ask for step-by-step instructions or code


explanations, especially if you aren’t
familiar with Visual Basic
Generate Formulas from Sample Data
Please write an Excel function to extract the username (text before the “@” symbol)
from the E-mail column, based on the data sample below [insert data sample]
PROMPT
ENGINEERING

✓ Provide a sufficient, representative data


sample (ideally in csv format)

✓ Include details like table names and cell


references to generate formulas that don’t
require additional modification

✓ Regenerate the responses to test and


compare options (ChatGPT may not
provide the optimal solution)
Ask for Data Visualization Advice
I’m analyzing a sample of wine data and would like to understand the distribution
of wines by price point. What would be the best way to visualize this in Excel?
PROMPT
ENGINEERING

✓ Provide details about the dataset you’re


working with and desired output

✓ Include key words and phrases to help


ChatGPT identify the most appropriate
type of visual (distribution, relationship,
comparison, composition, trend, etc.)

✓ Use follow-up prompts to gather additional


details about how to structure the data and
create the visual
Troubleshoot Formula Errors
I’m using the Excel formula below to count the number of words in cell D2,
but it's returning a #VALUE! error in Excel. Can you tell me how to fix it?

=LEN(TRIM(D2))-LEN(SUBSTITUTE(TRIM(D2)," ","")+1) PROMPT


ENGINEERING

✓ Include the full formula in the prompt,


along with any additional context

✓ Provide specific details like cell references


and error types

✓ Regenerate the responses to test and


compare options (ChatGPT may not
immediately identify the error or provide
the optimal solution)
Produce Step-by-Step Tutorials
I have an Excel table containing the following fields: Order ID, Product, Quantity,
Retail Price, Revenue and Order Size.

I need to create a PivotTable showing the average revenue for each order size, PROMPT
formatted as currency (USD). Please provide clear, step-by-step instructions for ENGINEERING
creating the PivotTable using Excel for Office 365 on a PC.

✓ Be as clear and specific as possible

✓ Specify which version of Excel you’re using


and what the desired output looks like

✓ Regenerate the responses to compare


options (ChatGPT may not provide optimal
solutions, especially for more complex or
open-ended use cases)
Collaborate on Data Prep & EDA
I just exported a raw csv file containing web traffic data. Could you please act
like a Data Quality Assurance Engineer, and provide a step-by-step plan to help
me QA and prepare my data for analysis? PROMPT
ENGINEERING

✓ Provide context about your professional


role, the type of data you’re working with,
and your key objectives

✓ Specify the role you’d like ChatGPT to play


to set the tone and complexity of the
response

✓ Iterate and use follow-up prompts to


continue the conversation
Generate Sample Datasets
I'm a recently hired Data Analyst for an HR firm, looking for sample data that I
can use for practice. Please generate a sample dataset in CSV format
containing common fields that HR Analysts typically encounter on the job. PROMPT
Please also modify the sample to include some common data QA issues and ENGINEERING
describe what specific changes you made.

✓ Provide context about your role, industry,


and objectives

✓ Specify the type of data, number of


records, and format you’re looking for
(best for small samples in CSV format)

✓ Ask ChatGPT to provide a data dictionary


or summary of the sample dataset
WRAPPING UP

*Copyright Maven Analytics, LLC


KEY TAKEAWAYS

Tools like ChatGPT will change the way data professionals work
• Analysts will need to adapt and evolve to new technology to stay competitive in the age of AI

AI isn’t perfect, and may “hallucinate” or provide incorrect responses


• Remember that YOU are ultimately responsible for verifying the accuracy of the model output

Prompt engineering can dramatically improve response quality


• Be specific, provide meaningful context, and iterate to produce accurate and relevant responses

AI tools can be applied to many types of analytics use cases


• Tools like ChatGPT can help troubleshoot or generate code, automate tasks, and much more

*Copyright Maven Analytics, LLC


NEXT STEPS

In terms of AI revolutionizing the way analysts work, ChatGPT and Bard are only the beginning
• Just like the internet at the turn of the century, AI tools will fundamentally change the future of work

Our Advice:

✓ Stay up to date with new tools & technology


• The AI industry is evolving quickly, so make sure to follow the latest news and developments from trusted
companies and thought leaders in the space

✓ Be curious, but skeptical


• While we expect some amazing new AI developments in the coming years, we also expect to see some
unrealistic promises from companies trying to capitalize on the hype

✓ Build a well-rounded skill set


• As tools like ChatGPT begin to automate more complex technical tasks, focus on developing your uniquely
“human” skills like problem solving, strategic thinking, communication and business acumen

*Copyright Maven Analytics, LLC

You might also like