Crispo - Excel Challenge 32 2025

excel-challenges
weekly-exercises
Easy Sunday Excel Challenge
Published

August 10, 2025

Illustration for Crispo - Excel Challenge 32 2025

Challenge Description

Easy Sunday Excel Challenge

⭐ ⭐Filter staff without National ID

Solutions

library(tidyverse)
library(readxl)

path = "files/2025-08-10/Challenge 50.xlsx"
input = read_excel(path, range = "A2:C14")
test  = read_excel(path, range = "E2:E6")

param = "National ID"

result = input %>%
  nest_by(`Staff No.`) %>%
  mutate(has_id = any(data$Identifiers == param)) %>%
  filter(!has_id | is.na(has_id)) %>%
  select(`Staff No.`)

all.equal(result$`Staff No.`, test$`Staff Without National ID`)
# > [1] TRUE
  • 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-08-10/Challenge 50.xlsx"
param = "National ID"
input = pd.read_excel(path, usecols="A:C", skiprows=1, nrows = 12)
test  = pd.read_excel(path, usecols="E", skiprows=1, nrows = 4).squeeze().to_list()

result = (input.groupby('Staff No.')
            .filter(lambda g: param not in g['Identifiers'].values)
            ['Staff No.'].unique().tolist())

print(result == test) # True
  • Logic:

    • Reads the workbook range needed for the challenge

    • Aggregates or ranks values at the correct grouping level

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