Hockeydb is an archive for hockey statistics, trades, logos, draft picks, hockey cards checklists etc. It also has a daily update of team standings and transactions called The Morning Report.

- How many career points did Henri Richard have?
- What players were involved in the Phil Esposito trade?
- What year was Bunny Larocque the leafs #1 goalie

**It was unforgettable. F****ebruary 17 1979**. It was my dad’s 47th birthday (my current age). At this exact moment 39 years ago today we were driving to the game.

Nothing can compare to walking in and seeing the ice surface of Maple Leaf gardens. I remember **Mike Palmateer** bouncing all over the ice and seeing my favorite player **Darryl Sittler**. Wow! The leafs played the **L.A. Kings**. I followed **Marcel Dionne** whenever he was on the ice!

But the star that night was definitely **Walt McKechnie**.

Walt scored a hat trick as the **leafs won 5 to 2**. Using hockeydb I can explore Walt’s career and other players from both teams.

Just a few months after seeing my first NHL game I heard that the WHA was ending and four of their teams would join the NHL. **I didn’t even know that the WHA had existed!** Why didn’t anyone tell me?

The **79-80 NHL season** was incredible as a teenager from the WHA named Gretzky took the NHL by storm. NHL legends Dave Keon, Gordie Howe and Bobby Hull who had played in the WHA all played their final NHL season with the **Hartford Whalers**. Hockeydb makes it easy to explore this interesting year and stats from the WHA.

My first memory of Phil Esposito was as a Ranger playing against the Habs in the NHL finals. By reading his o-pee-chee hockey card I discovered that he had played with Bobby Orr on the Bruins. Hockey cards are great but HockeyDB is a treasure chest of free knowledge that has enabled me to go back and explore thousands of details.

For example, I only remember the very end of **Stan Mikita’s** career but hockeydb makes it easy to explore his career, teammates, etc. Search for a player and then click a link to see his teammates for any year! You can also click ‘Show Trades’ and ‘List Cards’.

Ralph Slate launched hockeydb in 1996 and has kept growing it. He is the principal data architect at ISO New England. He loves data. He loves hockey. Very cool. Read more about Ralph on **masslive.com** and **globeandmail.com** .

From the **GlobeandMail**:

Slate has spent about 20 hours a week maintaining HockeyDB over the years. During its two decades of operation, he’s compiled a set of encyclopedias’ worth of digital information: some 186,531 players, 7,220 teams, 416 leagues, 2,131 logos and 6,071 sets of hockey cards.

The best way to navigate **hockeydb.com** is simply to go there and start exploring. Nevertheless, I thought that it would be fun to **build dynamic hyperlinks to various places within hockeyDB.com using Excel’s hyperlink function**. Here is my **Excel file.**

My name is Kevin Lehrbass. I’m a data analyst an McKinsey & Company.

This is my personal blog about Microsoft Excel.

Long before I worked with Databases and Microsoft Excel I loved the data found in hockey & baseball cards. I also devoured the amazing information in Zander Hollander’s **sport’s year books**.

Each time we see a new Value it gets the max value above plus 1. If it’s a repeat Value then it gets the same Sequence number that was initially assigned.

=IFERROR(VLOOKUP(B4,$B$3:C3,2,FALSE),SUM(MAX($C$3:C3),1))

Notice the expanding range. The 1st cell is locked and the 2nd unlocked $B$3:C3 and $C$3:C3

If the Value already exists above VLOOKUP retrieves that sequence number. If VLOOKUP can’t find the Value (it’s new) then IFERROR gives us the max value from above. Visit **chandoo**!

I sometimes use expanding ranges but I rarely use them on large data-sets because they are so slow to calculate. So, what can we do? Here are some ideas:

**a) helper formulas & pivot table & vlookup**(pivot requires a refresh but so easy & quick)**b) 4 step formula solution**(faster than expanding ranges but requires some thought)**vba**(should be possible by vba experts)**Get & Transform**(possible?)

We use two helpers alongside the data: a **counter** and a **match function**. If the numbers are the same then it’s the 1st occurrence of that number. We’ll need these rows in the pivot. We add a 2nd counter beside the pivot. A vlookup back in column E looks into the pivot & 2nd counter (columns I & J). The pivot saves some formula calculation time and it’s easy to explain. Get the **Excel file(1 MB)**.

It only takes a few seconds to calculate but it takes some time to understand how it works. Follow along using the **Excel file(1 MB)**.

Type 1,2,3 and drag it down (or use the ROW function).

MATCH looks for the Value in column B. If MATCH position number = counter number this means that it’s a new Value.

I type a 1 in cell F4. In cell F5 the MAX formula compares two values to see which one is bigger. As I drag this formula down I’ll always have the max sequence number close for when it’s needed!

I type a 1 cell G4. In cell G5 I use the formula above. Let’s look at each part:

**=IF(D5=E5,F4+1,**** ** if **step 1** = **step 2** we know it’s a new value so we increase our sequence number.

**INDEX($G$4:$G$20003,E5))**** **if it’s a repeat value we use index with match number to get it.

Both of my solutions work well with 20000 rows of data. However, if the amount of data keeps increasing (i.e. 500000 rows) you would want to explore more robust solutions (vba, get & transform) to automate the sequence generation.

Can Get & Transform solve this? I’m currently enrolled in **Power Query Academy**. Why not sign-up and join me? Disclaimer: I’m also an affiliate for this course.

My name is Kevin Lehrbass. I live in Markham Ontario Canada. I’m a Data Analyst at McKinsey. This is my personal blog about Microsoft Excel.

I had two challenges this past weekend: 1) Chandoo’s sequencing challenge and 2) snow shoveling challenge! Mental and physical exercise!

]]>

We want separate ranks for Aristole and Richard Pryor. Here are two solutions:

**=SUMPRODUCT(($A$4:$A$12=$A4)*($B$4:$B$12>=$B4))**

**=COUNTIFS($A$4:$A$12,$A4,$B$4:$B$12,”>=”&$B4)**

Download my Excel file **here** to see how to do this.

Most recommend using the SUMPRODUCT function. Why? Maybe it evolved like this…

**Not as intense as the vlookup vs index/match debate but still interesting to compare:**

**COUNTIFS**

- It’s so
**simple**to use. Type**=COUNTIFS(**The screen tip guides you through the arguments. **Faster?!**On big datasets you might notice it’s faster than SUMPRODUCT.**Compatibility.**These days it’s not a major concern but ask first (what version do you have?).

**SUMPRODUCT**

- Initial time investment in learning this
**versatile/powerful**function is worth it! - There are
**no compatibility concerns**with this dude. He groves across the decades! **Might be slower**on big datasets.- Novice users may
**struggle to understand**(it is kind of funky)

I used SUMPRODUCT for years due to potential compatibility problems (**xlfn** error). But now it’s 2018! I use COUNTIFS

My name is Kevin Lehrbass. I’m a Data Analyst at McKinsey.

This is my personal blog about Microsoft Excel.

Fenton is on the left and Cali is on the right.

Fenton likes to keep things simple. He prefers COUNTIFS.

Cali is more ambitious and prefers SUMPRODUCT.

]]>

( **Disclaimer**: as of January 2018 I have enrolled in **Power Query Academy**. I’m also an **affiliate** )

**People like to spread out a single data set across several sheets based on a field** (i.e. Region). It might be easier to read the data but it’s challenging to use band-aid techniques to analyze it as a single data-set. 3D ranges, indirect function, etc might work but it’s not ideal.

It’s much easier to work with a single data-set. This is from Debra Dalgleish’s **newsletter**:

Last week, someone sent me a question about calculating recipe costs. They had

hundreds of recipes to calculate, and planned to make a separate worksheet for each recipe, with combo boxes to select ingredients. Yikes! I said that many sheets with combo boxes would make Excel explode!Never make a separate sheet for each recipe, or region, or anything elseyou’re keeping track of.Put all the info on one sheet, in a named Excel table, with a column that has the recipe name, or region, or whatever. Then,with everything in one list, you can filter, or sort, or create a pivot table to summarize the data. …Keep it simple — you’ll be happy that you did!

**If you really need to dynamically combine data across multiple tables here are two solutions.**

Watch my **video** to see the difference. It’s a **big** difference!

**Get & Transform (Power Query) is an amazingly tool that few people know about. It’s a built-in feature in Excel 2016.** Click ‘Data’ on the ribbon. It’s just a few steps!

- create a query for each Excel Table
- create a final query to append (combine) them
- put the combined data in a new table! Done!

Dynamically combining data from multiple Tables using formulas is CRAZY! You might have a better dynamic formula solution but **Get & Transform is definitely easier!**

My **video** explains how to use my formula solution. Download my **Excel file** to audit my long formulas!

Last week I signed up for **Power Query Academy** ! Join me in this adventure**! **Get & Transform can do so many amazing things to fix your data and save you time! And it’s a free tool!

My name is Kevin Lehrbass. I live in Markham, Ontario, Canada.

In 2017 I watched several Power Query videos. It’s an amazing tool! This year I’ve enrolled in **Power Query Academy**!

I’m a Data Analyst at McKinsey & Company.

Check out my **YouTube videos** and my **blog posts**.

**“the smallest 12 values in column D become rank 1…NEXT 12 lowest averages become rank 2 etc”**

My first step is to rank all of the individual average values: **=RANK(D6,$D$6:$D$48,1)**

I used a 1 in Rank’s 3rd argument so that the smallest number would be ranked as 1.

Now we bin the rank value above using this **=MATCH(F6,{1,13,25,37,49},TRUE)**

There are two important things happening inside this **MATCH** function:

**lookup_array**, 2nd argument, is**array constant**! Values are inside formula not in a range of cells**match_type**, 3rd argument, is TRUE. It’s an approximate match (not exact match). We are binning!

We could easily combine the two steps above into only 1 formula

**=MATCH(RANK(D6,$D$6:$D$48,1),{1,13,25,37,49},TRUE)**

The original requirement was to have groups of 12. If the groups need to have different sizes then we can easily adjust the values in our array constant. For example **{1,5,31,35,49}**

Also, it’s important to note that we don’t have to use an array constant. We could easily put our bin values in a range (see **Solution 1c** in my Excel file below)

**Bart Titulaer’s solution is a better solution if the bin sizes remain constant!**

**=ROUNDUP(RANK(D8,$D$6:$D$48,1)/12,0) **

How does it work? RANK the value in cell D8 (608.33). Wrap it with ROUNDUP.

- Highlight
**RANK(D8,$D$6:$D$48,1)**and press F9 key. You get**27**. - 27 divided by 12
**27/12**gives us 2.25 - ROUNDUP function rounds 2.25 up to
**3**!!

**Brilliant!** Thanks Bart for the solution!

Download my Excel file **here.** Watch my video **here**.

The group where I found the question **https://www.reddit.com/r/learnexcel/**

Related group **https://www.reddit.com/r/excel/**

My name is Kevin Lehrbass. I live in Markham, Ontario, Canada.

About 20 years ago I remember seeing a friend working on an Excel spreadsheet. It looked interesting. I thought to myself **“What if I could learn more about Microsoft Excel than I know about Chess & Spanish?”**

At the time it seemed like a distant possibility but I started learning and I’ve never looked back

I’m a Data Analyst at McKinsey & Company.

Check out my **YouTube videos** and my **blog posts**.

I changed the sample text so that we have three sentences and “2nd” in the middle.

this is a test. second 2nd test. third test.

The result should look like this (first letter of each sentence is capitalized)

This is a test. Second 2nd test. Third test.

I added color to the different parts to make it more readable.

Let’s start with the purple part that is in the middle. Everything else is wrapped around it.

Change everything to lower case. Substitute **“. “** (end of sentences) with **“9z9”**. We get this:

**this is a test9z9second 2nd test9z9third test.**

Next, substitute all remaining spaces with **“zxz”. **We get this:

**thiszxziszxzazxztest9z9secondzxz2ndzxztest9z9thirdzxztest.**

** Here is the key part.** After each number the next letter gets capitalized. We end up with:

**Thiszxziszxzazxztest9Z9Secondzxz2Ndzxztest9Z9Thirdzxztest.**

Notice in the text above that the first letter in each sentence (‘This’ ‘Second’ ‘Third’) are capitalized. HOWEVER, the “N” in “2nd” is also capitalized. Maybe it’s not important….but what if it is?

**Putting it back together:** the two substitutes to the left of the PROPER function reverse the original substitutions. We get:

**This is a test. Second 2Nd test. Third test.**

Puneet’s formula is amazing! ….Except numbers with a letter attached to the end are capitalized.

In his original text “**with 1000s**” becomes “**with 1000S**“. In my text example the “**2nd**” becomes “**2Nd**“.

**It’s a minor detail and maybe it doesn’t matter. But if it does matter what can we do?**

I spent some time thinking of how to modify Puneet’s formula. Then I thought about an array formula…**YIKES! It started to get complicated**. VBA? Possible, but it would take me hours.

**What about helper formulas?** Using various formulas in a step by step approach is sometimes frowned upon. Over the years I have embraced it. Why? Instead of one monster formula or vba code that few understand helper formulas allow us to break the solution into understandable pieces. It’s much easier to teach the solution to someone else and also easier to audit later on.

Download my Excel file–> **sentence-case (Puneet & Kevin).xlsx****.**

My name is Kevin Lehrbass. I live in Markham, Ontario, Canada. I’m a Data Analyst at McKinsey & Company.

There are many amazing data tools out there. Microsoft Excel is one of them and it’s the universal tool that everyone has!

Check out my **YouTube videos** and **blog**.

]]>

Has your Excel model become a monster because it’s so big and slow? **Tom Gauld’s** comic says it all!

Over the years I have noticed many habits of spreadsheet users. Many work quickly adding formulas and data until the model becomes unbearably slow to calculate. At this late stage in the process they look for help.

Do I recommend re-building the model or can it be salvaged? Should parts of the model be re-built using VBA? Difficult to say until you dive in and see what’s going on.

I often find thousands of formulas that are calculating for no reason whatsoever. Adding an off switch can drastically reduce calculation time.

Don’t worry: it’s a smart off switch that will turn back on when needed.

Requirement: extract non blank values starting in column A moving down and to the right. This tiny example demonstrates how an Off Switch is helpful. Imagine a massive amount of data.

=COUNTA(A1:D6)

This light formula in cell G1 counts non blank entries in the range above. This is the Off amount.

=IF($G4>$G$1,””,SMALL(IF($A$1:$D$6<>””,COLUMN($A$1:$D$6)+ROW($A$1:$D$6)/1000,””),$G4))

Key part of formula in cell J4 is: IF($G4>$G$1,”” It compares cell G4 to the off value. Once the counter is greater than the off amount the formula stops (heavy array is ignored).

**Why make Excel calculate to get the 20th value when we know it doesn’t exist? There are only 13!**

If all 24 cells are filled in then the formula is turned back on and you’ll see all the answers!

You might have a simple formula dragged down 400000 rows waiting for data to be added later. The off switch technique can often help.

Download my Excel file **here.**

Excelxor’s **post** explains the off switch and why we shouldn’t wrap heavy formulas with IFERROR.

A special thank you to **Tom Gauld** for letting me use his comic. It was the perfect comic for this post! Tom is a cartoonist and illustrator. His work is often published in The Guardian, The New York Times and New Scientist. I’ve followed his comics for a couple of years now and really enjoy them. I often take a break at work and scroll his **Tumblr** or **Twitter** feeds. **Baking With Kafka** is my favorite book of his!

My name is Kevin Lehrbass. I live in Markham, Ontario, Canada. I’m a Data Analyst at McKinsey & Company.

Away from Excel I might be reading comics from: **Tom Gauld**, **Roz Chast**, **Edward Steen**, etc or playing with my dogs.

Check out my **YouTube videos** and **blog**.

Here are Leila’s original requirements. I will review several solutions (formula & non formula).

Visit Leila’s **blog**!

Or click **here** to watch. Download my Excel file **here**.

**FAST/GOOD/CHEAP** pick two! It’s often the same in Excel but we have **LIGHT/SIMPLE/DYNAMIC**.

Use built-in Excel tools! No formulas, no code! SUPER FAST but not dynamic. Watch Bill’s **video**

Power Query (Get & Transform) is amazing but it requires a refresh. Watch Oz’s **video**

I love array formulas! This one is long but brilliant! Watch Mike’s videos **here** and **here**

Leila’s compact formula is amazing! Just be careful with expanding ranges if you have a lot of data.

=IFERROR(INDEX(TableDiv[Division],MATCH(0,INDEX(COUNTIF($D$7:D7,TableDiv[Division]),),0)),””)

Leila’s **video** and **blog**. Here is the **video** in Polish by **Piotr Majcher**

If you need a dynamic and simple solution then consider my solution (see my video above).

In the Excel file (above) I made my solution more efficient (important for large data-sets).

Mike reminds us to look for the super easy solution whenever possible. Great solution for data input. Mike’s **video** and **post**.

**Piotr Majcher** told me about this **post** from Oscar Cronquist. Great examples for creating unique / distinct list!

XLarium’s comment below show us how to use M code to automatically refresh a Get & Transform query!

What do you think? Add a comment below.

My name is Kevin Lehrbass. I live in Markham, Ontario, Canada.

About 20 years ago I remember seeing a friend working on an Excel spreadsheet. It looked interesting. I thought to myself **“What if I could learn more about Microsoft Excel than I know about Chess & Spanish?”**

At the time it seemed like a distant possibility but I started learning and I’ve never looked back

I’m a Data Analyst at McKinsey & Company.

Check out my **YouTube videos** and my **blog posts**.

]]>

Why can’t we simply use Data Validation? **The list has 2551 items! Scrolling back and forth is PAINFUL !**

**Let’s create a shorter list based on a keyword!**

Before we jump into solving this **ask a few questions to determine the exact requirements!**

A few easy steps to create this solution. But…it takes longer to change the keyword.

- super quick to create
- dynamic named range could be eliminated if required
- built in options include: wildcards, ‘starts with…’, ‘ends with…”, etc.

Free vba add-in from **Jon Acampora**! But…challenging to modify / troubleshoot for non vba users.

- ready to use solution!
- free!

Allows multiple keywords! But…arrays can be very tricky for most Excel users.

- less steps than non array formula solution
- multiple keywords are allowed

Only simple formulas used! But…only one search word allowed. More formulas required.

- much easier to audit this solution

Advanced filter! But…not fully dynamic (you’d have to re-run this a lot).

- quick to create and update
- no advanced vba or formula knowledge required

Check out Debra’s **video** and **post**!

Download it **here** or from my **OneDrive** (00158 Keyword Data Validation List.xlsx)

I review the solutions above **YouTube video**.

My name is Kevin Lehrbass. I live in Markham, Ontario, Canada.

About 20 years ago I remember seeing a friend working on an Excel spreadsheet. It looked interesting. I thought to myself **“What if I could learn more about Microsoft Excel than I know about Chess & Spanish?”**

At the time it seemed like a distant possibility but I started learning and I’ve never looked back

I’m a Data Analyst at McKinsey & Company.

Check out my **YouTube videos** and my **blog posts**.

**Not convinced that you can become an Excel master?** I used to think that I wasn’t a numbers person (fixed mindset)! A combination of **curiosity, interest, necessity and determination paved my path to becoming a data analyst**. I’ve changed from more of a Fixed Mindset to a Growth Mindset person! **Studying formula collections is an excellent way to build your knowledge**.

Author Michael Erard explored language super learners. Those with a fixed mindset might say that it’s easy for them to learn so many languages due to their natural abilities. I disagree. Natural abilities may provide a slight advantage or head start but I think **their success is mostly due to an incredible amount of curiosity, passion and determination**. From the book’s last page:

One reason that Mezzofanti and people like him are so fascinating is that they seem to have leapfrogged the banality of method. They don’t learn languages; they pick them up. They don’t sit down and read lists of words: they absorb them. We hope that the methods are magic, and that if we adopt those methods too, we might achieve great things.

The truth is, Mezzofanti and others haven’t escaped the banality of methods at all; they make the banality more productive. Their minds enjoy the banality.The nature of the methods themselves doesn’t seem to matter. Johan Vandewalle told me something that bears repeating: Whatever the method is…stick to the method. That’s the method.”

Above the quote was a picture of Mezzofanti’s massive flash card collection. **Mezzofanti spent hours and hours studying and practicing languages! Anyone can learn!**

**Have I convinced you yet? Enjoy the banality of studying these free formula example collections!**

Debra Dalgleish 1: **http://www.contextures.com/tiptech.html**

Debra Dalgleish 2: **http://www.contextures.com/excelfiles.html **

Mynda Treacy: **https://www.myonlinetraininghub.com/excel-formulas**

Dave Bruns: **https://exceljet.net/formulas**

**What else can you do to learn Excel?**

**Subscribe to 5 Microsoft Excel YouTube channels****Buy a book****Take a course****Think of something that interests you and build an Excel model**

Excel: **Massive forum of super learners** **https://www.mrexcel.com/forum/index.php**

Excel: **Mike Girvin** (I’m a super fan) **https://www.youtube.com/user/ExcelIsFun/videos**

Languages: **Youlden twins** **www.babbel.com/en/magazine/polyglot-bros-language-rival**

Languages: List of **polyglots** **www.fluentu.com/blog/polyglot-language-learning/**

Chess: Free & paid options for **learning & playing chess** **www.chess.com**

Spanish: **Listen & learn **on your laptop or smartphone **http://redamf21.com/**

My name is Kevin Lehrbass. I live in Markham, Ontario, Canada.

Learning Chess and Spanish have been fun hobbies for me. About 20 years ago I remember seeing a friend working on an Excel spreadsheet. It looked interesting. I thought to myself **“What if I could learn more about Microsoft Excel than I know about Chess & Spanish?”**

At the time it seemed like a distant possibility but I started learning and I’ve never looked back

I’m a Data Analyst at McKinsey & Company.

*There are so many amazing things that you can do with Microsoft Excel !*

Check out my **YouTube videos** and my **blog posts**.