Download as xlsx, pdf, or txt
Download as xlsx, pdf, or txt
You are on page 1of 23

Formula Challenge - convert Y/N to days of week

Input Output Key


NYNYNYN ---> #VALUE! MWF
NNYNYNN ---> #VALUE! TT
NYYYYYN ---> #VALUE! MTWTF
NYNNNYN ---> #VALUE! MF
YYYYYYY ---> #VALUE! SMTWTFS
Summary
In this challenge, the goal is to end up with a text string like "MWF" for Monday, Wednesday, Friday. The problem is that the weekdays are input as yes/n
What formula will translate the "N" and "Y" to weekday abbreviations?

A long-time reader sent me an interesting problem this past week. The goal is to end up with a text string like "MWF" for Monday, Wednesday, Friday. Th
yes/no abbreviations like "NYNYNYN" for "MWF".

Challenge
What formula will translate the "N" and "Y" to weekday abbreviations as shown in the screenshot above?

The workbook is attached below. Post your answer in the comments.

Extra points for style and elegance, but workhorse solutions are fine, too :)

Assumptions
All inputs are 7 characters and contain only "Y" or "N"
Days are mapped Sunday through Saturday, SMTWTFS.
Formula challenge - multiple OR criteria

Item Color City Item Color City


Tshirt Red Seattle Tshirt Red Denver
Sandals Gray Portland Hoodie Blue Seattle
Hat Blue Denver Green #NAME?
Hoodie Blue Bend
Tshirt Blue Bend Formulas to get correct counts: 8
Sandals Black Portland
Tshirt Blue Denver 7 6 2 6
Hoodie Gray Portland
Sandals Gray Seattle named ranges:
Tshirt Gray Seattle
Sandals Black Portland item = B3:B16
Hoodie Green Portland color = C3:C16
Hat Black Portland city = D3:D16
Sandals Gray Seattle
Summary
One problem that comes up a lot in Excel is counting or summing based on multiple OR conditions. For example, perhaps you need to analy
Seattle
One or Denver,
problem for items
that comes up that
a lotare Red, Blue,
in Excel or Green?
is counting This canbased
or summing be surprisingly
on multipletricky, so naturally
OR conditions. it makes
For a good
example, challenge!
perhaps you need to analy
Seattle or Denver, for items that are Red, Blue, or Green? This can be surprisingly tricky, so naturally it makes a good challenge!
The challenge

The data below represents orders, one order per row. There are three separate challenges.

What formulas in F9, G9, and H9 will correctly count orders with the following conditions:

F9 - Tshirt or Hoodie
G9 - (Tshirt or Hoodie) and (Red, Blue, or Green)
H9 - (Tshirt or Hoodie) and (Red, Blue, or Green) and (Denver or Seattle)

The green shading is applied with conditional formatting and indicates matching values for each set of OR criteria in each column.

For your convenience, the following named ranges are available:

item = B3:B16
color = C3:C16
city = D3:D16
Formula challenge - flag out of
sequence codes
Which codes are out of sequence?

Code Flag
A001
A002
A003
A005
B001
B002
B004
C001
C002
Which codes are out of sequence?

Code Flag
A001 )
A002
A003
A005
B001
B002
B004
C001
C002
A004
Summary
We have a simple list of 4-digit alphanumeric codes like A001, A002, A003, etc. What formula can we use to mark codes that are "out of
sequence" with previous entries? This problem includes two separate challenges.
The Problem

We have a list of alphanumeric codes. Each code consists of a single letter (A, B, C, etc.) followed by a 3-digit number. These codes should appear in alpha

Challenge #1

What formula in the "Check" column will place an "x" next to a code that is out of sequence? In this challenge, we are only checking that the *numeric*

Challenge #2
How can the formula above be extended to check if "alpha" part of the code (A,B,C, etc.) is out of sequence? For example, we should flag a code that beg

Download the worksheet below and take the challenge!

Note: there are 2 sheets in the workbook, one for Challenge #1, one for Challenge #2.
r in alphabetical order, but sometimes they are out of sequence. We want to flag out-of-sequence codes.

umeric* portion of the code is out of sequence, not that the letter itself is out of sequence.
that begins with "A" if it appears after a code that begins with "C" or "B".
Formula challenge - build answer key for tests

Question key Answer key

Test A Test B Test C Test D # Test A Test B Test C Test D


1 4 18 14 1 C
2 19 8 1 2 C
3 2 10 7 3 A
4 12 4 15 4 B
5 16 2 8 5 E
6 5 16 18 6 C
7 3 6 17 7 C
8 7 15 5 8 C
9 6 7 16 9 A
10 15 5 2 10 D
11 18 19 6 11 B
12 8 14 11 12 B
13 1 3 9 13 E
14 10 9 13 14 C
15 13 11 10 15 D
16 9 12 3 16 D
17 17 1 12 17 B
18 11 17 4 18 C
19 14 13 19 19 E
Summary
In this formula challenge, we have four tests (Test A, Test B, Test C, and Test D), all with the same 19 questions, but listed in a different orde
What formula can be used to match questions and construct an answer key for all tests? A perfect use for Excel's powerful lookup formulas.
The problem

There is one master test (Test A), and three variants (Test B, Test C, and Test D). All 4 tests have the same 19 questions, but arranged in a different order.

The first table in the screen below is a "question key" and shows how questions in Test A are ordered in the other 3 tests. The second table is an "answer
Above: Correct answers in I5:K23, formula obscured

For example, the answer to question #1 in Test A is C. This same question appears as question #4 in Test B, so the answer to question #4 in Test B is also

The first question in Test B is the same as question #13 in Test A, and the answer to both is E.

The challenge

What formula can be entered in I5 (that's an i as in "igloo") and copied across I5:K23 to find and display the correct answers for Tests B, C, and D?

You'll find the Excel file below. Leave your answer as a comment below.
nswer key" that shows the correct answers for all 19 questions in all tests.
Formula puzzle - how long was the truck stopped?

Truck locations at each hour of one day

Time of day
8 9 10 11 12 1 2 3 4 5
Truck1 A B C D A B C D A A
Truck2 A A A A A C D D B A
Truck3 A A A A A A A A A A
Truck4 A B C B A B C D E A
Truck5 A B C D A B C D A A
Stopped
Summary
In this formula puzzle, we look at truck location GPS data, and ask: what formula will calculate the hours that each truck was stopped during
A couple weeks ago, a reader sent me an interesting question about tracking the "stopped time" for a fleet of trucks. The trucks are tracked by GPS so a l

The challenge: what formula in column N will correctly calculate total hours stopped?

I've simplified this a bit by replacing actual GPS coordinates with locations labeled A-E, but the concept remains the same.

The puzzle

For how many hours was each truck stopped?


Or, in Excel-speak:

What formula will calculate the total hours each truck was stopped?

For example, we know Truck1 was stopped for 1 hour because its location was recorded as "A" at both 4 PM and 5 PM.

Assumptions

There are 5 locations with these names: A, B, C, D, E


A truck at the same location for two consecutive hours = 1 hour stopped

Got a formula that will do it?


orded at each hour of the day for each truck. The data looks something like this:

You might also like