Skip to main content

Command Palette

Search for a command to run...

Excel Tutorial

Updated
•11 min read•View as Markdown
Excel Tutorial

1. Introduction to Data Analysis in Excel

Excel is a powerful tool used for data manipulation, analysis, and visualization. With its built-in functions and add-ins, Excel allows users to perform statistical analysis, create dashboards, and generate insights from large datasets.

2. Getting Started with Excel

2.1 Opening and Importing Data

  • Open Excel.

  • To import data, click on the Data tab → Get Data from various sources like text, CSV, web, or databases.

  • For large data, choose Get Data from Text/CSV and select your file.

2.2 Data Preparation

  • Once the data is imported, check for blank cells, duplicates, and errors.

  • Use Sort & Filter to filter out irrelevant data.

  • Use Find & Replace (Ctrl + H) to correct errors or replace unwanted characters.

3. Cleaning Data

3.1 Removing Duplicates

  • Select the range containing your data.

  • Go to the Data tab and click on Remove Duplicates. Choose columns that should be considered for duplicate detection.

3.2 Handling Missing Data

  • Highlight the data and go to Home → Find & Select → Go To Special → select Blanks to find all missing data.

  • Fill in missing data using:

    • Manual Input.

    • Fill Series for numeric sequences (Home → Fill → Series).

    • Use Functions: For example, =IF(ISBLANK(A2), "Missing", A2).

3.3 Using Text Functions

  • LEFT, RIGHT, MID: Extract parts of text. Example: =LEFT(A2, 4) will take the first 4 characters from cell A2.

  • TEXT TO COLUMNS: Split text into multiple columns (Data → Text to Columns).

4. Data Transformation

4.1 Sorting Data

  • Select the range and use Sort & Filter from the Home tab.

  • You can sort alphabetically, numerically, or by custom criteria.

4.2 Filtering Data

  • Use Filter (Data → Filter) to display only relevant data.

  • Set criteria to filter columns, e.g., by specific text, numbers, or dates.

4.3 Conditional Formatting

  • Highlight data using color schemes based on specific criteria.

  • Select data → Home → Conditional Formatting.

    • For example, format cells that are greater than a certain value.

5. Basic Statistical Functions

Excel has several built-in functions that can be used for statistical analysis:

5.1 Descriptive Statistics

  • AVERAGE: =AVERAGE(range)

  • MEDIAN: =MEDIAN(range)

  • MODE: =MODE(range)

  • STDEV: =STDEV.P(range) (for entire population) or =STDEV.S(range) (for a sample).

  • COUNT: =COUNT(range) counts the number of numeric values.

5.2 Frequency Distribution

  • Use FREQUENCY function to create frequency distribution.

  • Example: =FREQUENCY(B2:B10, D2:D5) where B2:B10 is your dataset and D2:D5 are your bins.

6. Pivot Tables

6.1 Creating Pivot Tables

  • Go to Insert → Pivot Table.

  • Select the data range and choose whether you want the Pivot Table on the current sheet or a new sheet.

  • Drag fields to the Rows and Columns area to categorize the data.

  • Drag fields to the Values area to apply summary statistics like SUM, AVERAGE, COUNT, etc.

6.2 Pivot Table Options

  • Summarize Values By: Change the summary type (sum, average, count, etc.).

  • Show Values As: Show as percentage of totals, running totals, etc.

  • Filters: Filter data in your Pivot Table.

7. Data Visualization

7.1 Charts

  • Highlight data and go to Insert → Charts. Excel will suggest charts based on your data.

    • Common charts include:

      • Bar/Column Chart: Shows comparison across categories.

      • Line Chart: Useful for time-series data.

      • Pie Chart: Shows proportion of data.

      • Scatter Plot: Visualizes correlation between two variables.

  • Chart Design tab: Customize your chart with titles, labels, colors, etc.

7.2 Slicers

  • Slicers provide a visual way to filter data.

  • Insert a Slicer (from PivotTable Tools or Insert tab), and it will allow you to filter Pivot Tables easily.

8. Advanced Analysis Tools

8.1 Data Analysis Toolpak

  • Go to File → Options → Add-ins. Click Go next to Manage Excel Add-ins.

  • Check Analysis ToolPak and click OK.

Once activated:

  • Go to Data → Data Analysis.

  • Available tools include:

    • Descriptive Statistics: Summarizes data with measures of central tendency (mean, median), dispersion (variance, standard deviation), etc.

    • Regression: Performs linear regression analysis.

    • ANOVA: Analyzes variance between means.

    • t-Test: Compares two sample means.

8.2 Using Regression Analysis

  • Go to Data → Data Analysis → Regression.

  • Select Input Y Range (dependent variable) and Input X Range (independent variables).

  • Click OK. Excel will output a summary, including R-squared, p-values, coefficients, etc.

8.3 What-If Analysis

  • Go to Data → What-If Analysis:

    • Scenario Manager: Create scenarios to compare different sets of values.

    • Goal Seek: Find the input needed to achieve a specific result.

    • Data Tables: Explore different outcomes based on input variations.

9. Automating Data Analysis

9.1 Macros

  • Use Macros to automate repetitive tasks.

  • Go to View → Macros → Record Macro. Perform the steps you want to automate.

  • To run the Macro, go back to View → Macros → View Macros → Select your macro and click Run.

9.2 VBA for Data Analysis

  • Press Alt + F11 to open the VBA editor. You can create custom functions to automate complex data analysis tasks.

Example of a simple function to calculate the variance:

Function CalculateVariance(dataRange As Range) As Double
    Dim sum As Double, mean As Double, variance As Double
    Dim count As Integer, i As Integer
    count = dataRange.Count
    For i = 1 To count
        sum = sum + dataRange.Cells(i, 1)
    Next i
    mean = sum / count
    For i = 1 To count
        variance = variance + (dataRange.Cells(i, 1) - mean) ^ 2
    Next i
    CalculateVariance = variance / count
End Function

This custom function can be used in Excel as =CalculateVariance(A1:A10).

10. Dashboards

10.1 Creating a Dashboard

  • Use a combination of Pivot Tables, Charts, Slicers, and Conditional Formatting to create an interactive dashboard.

  • Arrange your visuals on a single sheet for easy access to insights.

10.2 Interactive Elements

  • Use Form Controls (Developer Tab) to add buttons, sliders, checkboxes, etc., for interactive analysis.

    2. Types of Charts in Excel

    2.1 Common Chart Types

    • Column Chart: Ideal for comparing data across categories.

    • Bar Chart: Horizontal bars representing data, useful for categorical comparison.

    • Line Chart: Best for showing trends over time.

    • Pie Chart: Shows parts of a whole, great for displaying percentages.

    • Scatter Plot: Displays relationships between two numerical variables.

    • Area Chart: Similar to line charts but with shading under the line.


3. Preparing Data for Charts

Before creating any chart, make sure your data is organized. Here are some tips for preparing your data:

  • Organize Data in Columns or Rows: Each column or row should represent one category or series.

  • Use Descriptive Labels: Include meaningful labels for categories and data points.

  • Check for Blank Cells: Ensure there are no blank cells in the dataset, as it might affect the chart’s accuracy.

For example, if you have sales data for different regions:

RegionQ1 SalesQ2 SalesQ3 SalesQ4 Sales
North5000600070008000
South4000500045006000
East3000450050007000
West3500470052006800

4. Creating Charts in Excel

4.1 Creating a Basic Chart

  1. Select the Data: Highlight the data you want to represent in the chart.

    • Example: Select the range A1:E5 for the sales data.
  2. Insert the Chart:

    • Go to the Insert tab.

    • Choose the chart type from the Charts group (Column, Line, Pie, etc.).

    • Excel will insert the chart into the worksheet.


4.2 Column Chart Example

  1. Select Data: Select your dataset, e.g., A1:E5 (Region vs. Sales).

  2. Insert Column Chart:

    • Go to Insert → Column or Bar Chart.

    • Choose Clustered Column Chart (the most common type).

  3. Customize Chart:

    • Add titles, labels, and adjust colors.

    • To add chart elements, click the Chart Elements (the plus icon next to the chart) and choose items like axes, data labels, legends, and gridlines.

  4. Formatting:

    • Select the chart and use the Chart Tools ribbon to change the layout, styles, and design.

4.3 Line Chart Example (Time-Series)

  1. Select Data: Highlight your data (e.g., dates and sales figures).

  2. Insert Line Chart:

    • Go to Insert → Line Chart.

    • Choose the Simple Line Chart.

  3. Customize the Chart:

    • Change the title by clicking on the title box and editing.

    • Add Data Labels to show specific values on each data point (Chart Elements → Data Labels).


5. Customizing Charts

5.1 Adding Chart Title

  • Click on the chart title placeholder or go to Chart Elements (the plus sign next to the chart) and select Chart Title.

  • Type a new title directly.

5.2 Adding Axis Titles

  • To add titles for X and Y axes, go to Chart Elements → Axis Titles.

  • Label the Horizontal (Category) Axis and Vertical (Value) Axis appropriately.

5.3 Changing Chart Colors and Styles

  • Select the chart, then navigate to the Chart Tools → Design tab.

  • Choose a Chart Style to apply predefined formats.

  • To customize colors, click on Change Colors and choose from the available palettes.

5.4 Data Labels and Legends

  • Data Labels: Add data labels by selecting Chart Elements → Data Labels. You can show values on each bar, line, or pie slice.

  • Legends: Enable or disable legends by selecting Chart Elements → Legend. You can position it (top, right, bottom, or left) by clicking the arrow next to Legend.


6. Creating a Pie Chart

6.1 Inserting a Pie Chart

  1. Select Data: For a pie chart, select data with one series. For example:

    | Product | Sales | | --- | --- | | A | 500 | | B | 300 | | C | 200 |

    Highlight this data (A1

    ).

  2. Insert Pie Chart:

    • Go to Insert → Pie Chart → 2D Pie.
  3. Customizing the Pie Chart:

    • Add Data Labels to show the percentage or value for each slice.

    • Format the slices by right-clicking on any slice and choosing Format Data Series to change the color, border, and other features.

6.2 Pie Chart Customizations

  • Exploding a Slice: Click on the slice and drag it away from the pie to “explode” it for emphasis.

  • Change Data Label Format: To display percentages, click on a label, go to Label Options and choose Percentage.


7. Advanced Charts

7.1 Creating a Scatter Plot (XY Chart)

Scatter plots help analyze the relationship between two variables (e.g., Height vs. Weight).

  1. Select Data: Highlight two related columns (e.g., Height and Weight).

  2. Insert Scatter Plot:

    • Go to Insert → Scatter Chart.

    • Choose Scatter (with or without connecting lines).

  3. Customize: You can add trendlines (useful for regression analysis) by selecting Chart Elements → Trendline.

7.2 Combo Chart (Multiple Data Types)

A Combo Chart is useful for displaying multiple data types (e.g., column + line).

  1. Select Data: Highlight the dataset that has multiple categories.

  2. Insert Combo Chart:

    • Go to Insert → Combo Chart → Custom Combination Chart.

    • You can mix column charts with line charts for better comparison.

    • For example, use a Column Chart for sales data and a Line Chart for average growth.


8. Formatting and Fine-tuning

8.1 Axis Scaling

  • Right-click on the Y-axis (value axis) and select Format Axis.

  • Under Axis Options, you can change the Minimum and Maximum values to focus on a particular data range.

8.2 Gridlines

  • Add or remove gridlines via Chart Elements → Gridlines.

  • You can choose primary vertical or horizontal gridlines.

8.3 Changing Chart Type

  • If you want to change the chart type after it’s been created, click the chart, go to Chart Tools → Design → Change Chart Type, and select a new type.

8.4 3D Charts

  • For more visual appeal, Excel offers 3D Chart options under the Insert tab for column, pie, or bar charts.

  • While visually appealing, be cautious as 3D charts can distort the representation of data.


9. Creating Dashboards with Multiple Charts

9.1 Combining Charts in One Sheet

  1. Create multiple charts (as explained above) on the same sheet.

  2. Resize and move charts by dragging the edges.

  3. To align them neatly, right-click on a chart, choose Format Chart Area, and under Size & Properties, adjust the width and height for consistency.

9.2 Adding Slicers for Interactivity

Slicers allow interactive filtering of your charts:

  1. Create a Pivot Table from your data (Insert → Pivot Table).

  2. From PivotTable Tools, go to Insert Slicer and select the fields you want to filter by.

  3. Insert the Slicer, and when you select options in the slicer, the chart will automatically update to reflect the changes.


10. Exporting and Sharing Charts

10.1 Copying Charts to Other Applications

  • Select the chart, press Ctrl + C (or right-click and select Copy).

  • Paste the chart into Word, PowerPoint, or any other application by pressing Ctrl + V.

10.2 Saving Charts as Images

  • Right-click on the chart and select Save as Picture.

  • Choose a file format (e.g., PNG, JPEG) and save it for use in reports or presentations.

More from this blog

React Js blog

23 posts