Crispo - Excel Challenge 47 2024

excel-challenges
weekly-exercises
Easy Sunday Excel Challenge
Published

November 24, 2024

Illustration for Crispo - Excel Challenge 47 2024

Challenge Description

Easy Sunday Excel Challenge

⭐ Group 1 items Header Of Each Group Group 1 items 1 Group 1 items 21 Group 1 items 300 Group 1 items 450

Solutions

library(tidyverse)
library(readxl)

path = "files/Excel Challenge Nov 24th.xlsx"
input = read_excel(path, range = "B2:B14")

result = input %>%
  mutate(cond_form = ifelse(str_detect(Items, "\\D+ \\d+ \\D+ \\d+", negate = T), "Yes", ""))
  • Logic:

    • Reads the workbook range needed for the challenge

    • Builds the intermediate helper columns that drive the final answer

    • Uses direct text-pattern extraction instead of manual cleanup

  • 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

path = "Excel Challenge Nov 24th.xlsx"
input_data = pd.read_excel(path, usecols="B", skiprows=1, nrows=13)

pattern = r"\D+ \d+ \D+ \d+"
result = input_data.assign(cond_form=input_data["Items"].map(lambda x: "" if re.fullmatch(pattern, str(x)) else "Yes"))
print(result)
  • Logic:

    • Reads the workbook range needed for the challenge

    • Builds the intermediate helper columns that drive the final answer

    • Uses direct text-pattern extraction instead of manual cleanup

  • 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.