library(tidyverse)
library(readxl)
path = "files/2025-09-07/Challenge 57.xlsx"
input = read_excel(path, range = "B2:D8")
test = read_excel(path, range = "F2:K5")
result = input %>%
separate_longer_delim(`Assigned Staff`, delim = ", ") %>%
mutate(rn = row_number(), .by = `Assigned Staff`) %>%
select(-Activity) %>%
na.omit() %>%
pivot_wider(names_from = `Assigned Staff`, values_from = `Activity Code`) %>%
select(colnames(test))
all.equal(result, test)
# [1] TRUECrispo - Excel Challenge 36 2025
excel-challenges
weekly-exercises
Easy Sunday Excel Challenge

Challenge Description
Easy Sunday Excel Challenge
⭐ ⭐Filter Customers Missing all Data
Solutions
Logic:
Reads the workbook range needed for the challenge
Reshapes the data to the grain required by the task
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
path = "files/2025-09-07/Challenge 57.xlsx"
input = pd.read_excel(path, usecols="B:D", skiprows=1, nrows=6)
test = pd.read_excel(path, usecols="F:K", skiprows=1, nrows=3)
input_long = (
input.assign(**{'Assigned Staff': input['Assigned Staff'].str.split(', ')})
.explode('Assigned Staff')
.dropna(subset=['Assigned Staff'])
)
input_long['rn'] = input_long.groupby('Assigned Staff').cumcount() + 1
result = (
input_long.pivot(index='rn', columns='Assigned Staff', values='Activity Code')
.reindex(columns=test.columns)
.reset_index(drop=True)
)
result.columns.name = None
print(result.equals(test)) # TrueLogic:
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 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.