Bird
Raised Fist0
Excelspreadsheet~10 mins

Column and bar charts in Excel - Interactive Code Practice

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a column chart from data in cells A1 to B5.

Excel
ActiveSheet.Shapes.AddChart2(251, [1], Left:=100, Top:=50, Width:=400, Height:=300).Chart.SetSourceData Source:=Range("A1:B5")
Drag options to blanks, or click blank then click option'
AxlBarClustered
BxlPie
CxlLine
DxlColumnClustered
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing xlBarClustered creates a bar chart with horizontal bars.
Choosing xlPie or xlLine creates different chart types.
2fill in blank
medium

Complete the code to set the chart title to 'Sales Data'.

Excel
With ActiveSheet.ChartObjects(1).Chart
  .HasTitle = True
  .ChartTitle.Text = [1]
End With
Drag options to blanks, or click blank then click option'
A"Sales Data"
BSales Data
C'Sales Data'
DSales_Data
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting the quotes causes a syntax error.
Using single quotes does not work in VBA strings.
3fill in blank
hard

Fix the error in the code to change the chart type to a bar chart.

Excel
ActiveSheet.ChartObjects(1).Chart.ChartType = [1]
Drag options to blanks, or click blank then click option'
AxlBarClustered
BxlColumnClustered
CBarClustered
DxlPie
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'BarClustered' without 'xl' causes an error.
Choosing xlPie changes to a pie chart instead.
4fill in blank
hard

Fill both blanks to add data labels showing values on the chart.

Excel
With ActiveSheet.ChartObjects(1).Chart.SeriesCollection(1)
  .HasDataLabels = [1]
  .DataLabels.ShowValue = [2]
End With
Drag options to blanks, or click blank then click option'
ATrue
BFalse
C1
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Setting these to False hides the labels.
Using 1 or 0 instead of True/False may cause confusion.
5fill in blank
hard

Fill all three blanks to create a bar chart, set the title to 'Expenses', and show data labels.

Excel
With ActiveSheet.Shapes.AddChart2(251, [1], Left:=50, Top:=50, Width:=400, Height:=300).Chart
  .SetSourceData Source:=Range("A1:B5")
  .HasTitle = True
  .ChartTitle.Text = [2]
  .SeriesCollection(1).HasDataLabels = [3]
End With
Drag options to blanks, or click blank then click option'
AxlColumnClustered
B"Expenses"
CTrue
DxlBarClustered
Attempts:
3 left
💡 Hint
Common Mistakes
Using xlColumnClustered creates a column chart instead.
Forgetting quotes around the title causes errors.
Setting HasDataLabels to False hides labels.

Practice

(1/5)
1. What is the main difference between a column chart and a bar chart in Excel?
easy
A. Column charts can only show numbers, bar charts can show text.
B. Column charts display vertical bars, bar charts display horizontal bars.
C. Column charts are used for dates, bar charts are used for categories.
D. Column charts require formulas, bar charts do not.

Solution

  1. Step 1: Understand chart orientation

    Column charts show data with vertical bars, making it easy to compare values up and down.
  2. Step 2: Compare with bar charts

    Bar charts show data with horizontal bars, useful when category names are long or many.
  3. Final Answer:

    Column charts display vertical bars, bar charts display horizontal bars. -> Option B
  4. Quick Check:

    Chart orientation = vertical vs horizontal [OK]
Hint: Remember: columns go up/down, bars go left/right [OK]
Common Mistakes:
  • Confusing chart orientation
  • Thinking bar charts show text only
  • Believing formulas are needed for charts
2. Which of these is the correct way to insert a column chart in Excel?
easy
A. Select data, go to Insert tab, click Column Chart icon, choose style.
B. Type =COLUMNCHART() in a cell and press Enter.
C. Right-click a cell and select 'Create Chart' from the menu.
D. Use the Data tab and select 'Add Column Chart'.

Solution

  1. Step 1: Locate Insert tab

    In Excel, charts are inserted from the Insert tab on the ribbon.
  2. Step 2: Select data and choose chart

    After selecting your data, click the Column Chart icon and pick a style to create the chart.
  3. Final Answer:

    Select data, go to Insert tab, click Column Chart icon, choose style. -> Option A
  4. Quick Check:

    Insert tab + Column Chart icon = correct method [OK]
Hint: Use Insert tab, not formulas, to add charts [OK]
Common Mistakes:
  • Trying to create charts with formulas
  • Looking in wrong tabs like Data
  • Right-click menu does not have 'Create Chart'
3. Given this data in cells A1:B4:
A1: Month, B1: Sales
A2: Jan, B2: 100
A3: Feb, B3: 150
A4: Mar, B4: 120

If you create a column chart from this data, what will the chart show?
medium
A. Vertical bars for Jan=100, Feb=150, Mar=120 sales values.
B. Horizontal bars for Jan=100, Feb=150, Mar=120 sales values.
C. A pie chart showing percentage of sales per month.
D. A line chart connecting sales values over months.

Solution

  1. Step 1: Identify chart type and data

    Data has months and sales numbers. A column chart shows vertical bars representing values.
  2. Step 2: Understand chart output

    Each month will have a vertical bar with height matching its sales number.
  3. Final Answer:

    Vertical bars for Jan=100, Feb=150, Mar=120 sales values. -> Option A
  4. Quick Check:

    Column chart = vertical bars with values [OK]
Hint: Column chart bars go up for each value [OK]
Common Mistakes:
  • Confusing column with bar chart orientation
  • Expecting pie or line chart from column chart
  • Misreading data labels
4. You created a bar chart but the bars are vertical instead of horizontal. What is the likely mistake?
medium
A. You forgot to add data labels.
B. You selected the wrong data range.
C. You inserted a column chart instead of a bar chart.
D. You used a pie chart template by mistake.

Solution

  1. Step 1: Understand chart types

    Bar charts show horizontal bars; column charts show vertical bars.
  2. Step 2: Identify the cause of vertical bars

    If bars are vertical, you likely inserted a column chart by mistake.
  3. Final Answer:

    You inserted a column chart instead of a bar chart. -> Option C
  4. Quick Check:

    Vertical bars = column chart, not bar chart [OK]
Hint: Check chart type if bars are wrong direction [OK]
Common Mistakes:
  • Confusing bar and column charts
  • Blaming data range for bar orientation
  • Thinking data labels affect bar direction
5. You have sales data for 12 months in columns A and B. You want to create a bar chart that shows sales by month horizontally and highlight months with sales above 100 in a different color. How can you achieve this in Excel?
hard
A. Create a bar chart, then use conditional formatting on the chart bars to color above 100 differently.
B. Create a pie chart and use slice colors to highlight sales above 100.
C. Create a column chart and manually change bar colors for months above 100.
D. Create a bar chart, then add a helper column with IF formula to separate above 100 sales, and plot both series with different colors.

Solution

  1. Step 1: Prepare helper column with IF formula

    Create a new column with formula like =IF(B2>100,B2,NA()) to isolate sales above 100.
  2. Step 2: Create bar chart with two data series

    Plot original sales and helper column as two series; Excel will show bars in different colors automatically.
  3. Final Answer:

    Create a bar chart, then add a helper column with IF formula to separate above 100 sales, and plot both series with different colors. -> Option D
  4. Quick Check:

    Helper column + two series = color highlight [OK]
Hint: Use helper column with IF to color bars differently [OK]
Common Mistakes:
  • Trying conditional formatting directly on chart bars
  • Using column chart instead of bar chart for horizontal bars
  • Using pie chart which doesn't show bars