library(tidyverse)
library(readxl)
path = "files/2025-09-28/Challenge 67.xlsx"
input = read_excel(path, range = "B2:E8")
test = read_excel(path, range = "G2:J7")
result = input %>%
mutate(Prices = Prices + first(Prices),
Values = `Unit Values` + first(`Unit Values`)) %>%
filter(row_number() != 1) %>%
select(-`Unit Values`)
all.equal(result, test)
# [1] TRUECrispo - Excel Challenge 39 2025
excel-challenges
weekly-exercises
Easy Sunday Excel Challenge

Challenge Description
Easy Sunday Excel Challenge
⭐ Problem Adjusted Price and Unit Values Item Prices Units Values
Solutions
Logic:
Reads the workbook range needed for the challenge
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-28/Challenge 67.xlsx"
input = pd.read_excel(path, usecols="B:E", skiprows=1, nrows=7)
test = pd.read_excel(path, usecols="G:J", skiprows=1, nrows=5).rename(columns=lambda c: c.replace('.1', ''))
numeric_cols = input.select_dtypes(include='number').columns
for col in numeric_cols:
input[col] = input[col] + input[col].iloc[0]
result = input.iloc[1:].reset_index(drop=True)
result.columns = test.columns
print(result.equals(test)) # TrueLogic:
Reads the workbook range needed for the challenge
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 easy to moderate:
- The business rule is readable, but the workbook still needs a few careful transformation steps.