Excel BI - Excel Challenge 832

excel-challenges
excel-formulas
🔰 String Answer Expected Nostalgia Nosta Resilience Rile Eloquence oqnce Euphoria******** Euphori
Published

March 24, 2026

Illustration for Excel BI - Excel Challenge 832

Challenge Description

🔰 String Answer Expected Nostalgia Nosta Resilience Rile Eloquence oqnce Euphoria******** Euphori

Solutions

library(tidyverse)
library(readxl)

path = "Excel/800-899/832/832 Delete Characters Around Asterisks.xlsx"
input = read_excel(path, range = "A1:A10")
test  = read_excel(path, range = "B1:B10") %>%
  mutate(`Answer Expected` = replace_na(`Answer Expected`, ""))

result = input %>%
  mutate(result = str_remove_all(String, "(?<=\\*).|.(?=\\*)|\\*"))

all.equal(test$`Answer Expected`, result$result, check.attributes = F)
  • Logic: Read the workbook ranges needed for the challenge; Derive the required intermediate columns.
  • Strengths: The code maps the workbook rule into a compact, reproducible pipeline.
  • Areas for Improvement: The solution assumes the workbook layout and selected ranges remain stable, so any structural change in the sheet would require small adjustments.
  • Gem: The elegant part is how little code is needed once the correct intermediate representation is chosen.
import pandas as pd
import re
import numpy as np

path = "800-899/832/832 Delete Characters Around Asterisks.xlsx"
input = pd.read_excel(path, usecols="A", nrows=10)
test = pd.read_excel(path, usecols="B", nrows=10).fillna("")

input['Result'] = input['String'].str.replace(r'(?<=\*).|.(?=\*)|\*', '', regex=True)

print(input['Result'].equals(test['Answer Expected'])) # True

The Python version mirrors the same workbook logic with a concise, direct implementation.

Difficulty Level

Easy / Medium

The business rule is clear, though the workbook still needs a few transformation steps to reach the expected output.