Crispo - Excel Challenge 24 2025

excel-challenges
weekly-exercises
Easy Sunday Excel Challenge
Published

June 15, 2025

Illustration for Crispo - Excel Challenge 24 2025

Challenge Description

Easy Sunday Excel Challenge

⭐ ⭐Count the words with No Vowels and All Vowels

Solutions

library(tidyverse)
library(readxl)

path = "files/2025-06-15/Challenge 35.xlsx"
input = read_excel(path, range = "B3:B11")
test = read_excel(path, range = "D3:E4")

result = input %>%
  mutate(
    title = case_when(
      str_count(Names, "[AEIOUaeiou]") == 0 ~ "No Vowels",
      str_count(Names, "[AEIOUaieou]") == 5 ~ "All Vowels",
      TRUE ~ "Some Vowels"
    )
  ) %>%
  filter(title != "Some Vowels") %>%
  summarise(
    count = n(),
    .by = title
  ) %>%
  pivot_wider(
    names_from = title,
    values_from = count,
    values_fill = 0
  )
all.equal(result, test, check.attributes = FALSE)
# TRUE
  • Logic:

    • Reads the workbook range needed for the challenge

    • Reshapes the data to the grain required by the task

    • Aggregates or ranks values at the correct grouping level

    • Builds the intermediate helper columns that drive the final answer

  • Strengths:

    • The R solution stays compact and mirrors the workbook logic closely.
  • Areas for Improvement:

    • The code assumes the workbook layout and named ranges remain stable.
  • Gem:

    • The best part of the solution is choosing a tidy intermediate shape before producing the final answer.
import pandas as pd
import re

# Read data from Excel
path = "files/2025-06-15/Challenge 35.xlsx"
input = pd.read_excel(path, usecols="B", skiprows=2, nrows=9)
test = pd.read_excel(path, usecols="D:E", skiprows=2, nrows=1)

input['vowel_count'] = input.iloc[:,0].astype(str).apply(lambda name: sum(1 for c in name if c.lower() in 'aeiou'))
input['title'] = input['vowel_count'].apply(lambda vowels: "No Vowel" if vowels == 0 else ("All Vowels" if vowels == 5 else "Some Vowels"))
filtered = input[input['title'] != "Some Vowels"]

pivoted = filtered.value_counts('title').reindex(["No Vowel", "All Vowels"], fill_value=0).to_frame().T
pivoted.columns.name = None
pivoted.reset_index(drop=True, inplace=True)

print(pivoted.equals(test)) # True
  • Logic:

    • Reads the workbook range needed for the challenge

    • Reshapes the data to the grain required by the task

    • Applies the rule iteratively until the output is complete

  • Strengths:

    • The Python version keeps the same rule in a direct pandas-oriented workflow.
  • Areas for Improvement:

    • As with the R version, any workbook layout change would require small adjustments.
  • Gem:

    • The implementation stays close to the stated challenge instead of adding unnecessary complexity.

Difficulty Level

This task is moderate:

  • It combines familiar Excel-style logic with at least one non-trivial reshape, grouping, or parsing step.

  • The answer depends on getting the output layout exactly right.