Excel Challenge: What Does this Formula Do?

Excel Challenge: What Does this Formula Do?

The Scenario

We're taking over a workbook that someone else was using and there's an important but complicated formula in it. We need to know 2 things:

  • What does it do?
  • How can it be modified for a different purpose?

Here's the formula (the video is later in this post):

No alt text provided for this image

The Strategy

Rather than look at the long, nested formula, in the video, I invite you to play with the inputs and see how the output changes.

This is deliberate instruction because sometimes a formula is truly too overwhelming to comprehend, but that doesn't make the need go away. Sometimes we can figure out a formula's purpose by playing with it and seeing what it does.

The formula of question is in cell D5 (the pink cell). It calculates out to 2 when the inputs are January, Sales Rep: Gerri, Level: 25

No alt text provided for this image

In the following image, the result is 6 when the inputs are February, Sales Rep: Jean, Level: 25

No alt text provided for this image

What I want to highlight with this video is a difference between knowing that something works vs. knowing precisely how it works. This is important because real-world needs don't wait for us to be ready. Sometimes we need someone else to write a formula for us or we copy VBA code off of a website. We don't fully understand all the details. But we can test scenarios to see if it's working, and figure out enough to make minor modifications.

On multiple occasions I've worked with clients ... 2 or more hours spent developing a single formula. They don't know how to write the formula, but they know what the result should be, given certain inputs.

That's what we want to get at today. If you can read the formula, great. If you can't read the formula, can you play with it and figure it out?

Here's the video challenge and the solutions

Breaking the formula down (for those who are interested)

No alt text provided for this image
  • COUNTIFS counts the number of entries in range based on 1 or more criteria. Our criteria are: Month, Level and Rep
  • INDIRECT tells Excel to treat the parts of the formula as if they were a normal reference. An example might explain better.

=A3 refers to cell A3

=INDIRECT ("A"&3) also refers to cell A3.

So, why not just type 'A3'?

INDIRECT is helpful when the A and/or the 3 need to be calculated and that's what's happening in this challenge. We're building a reference to the Rep column in either the Jan or Feb tables.

If cell B5 contains 'Jan' then the reference will be: Jan[Rep].

That tells the formula to perform the COUNTIFS in the Rep column of the January table. By using the dropdown list and INDIRECT, the reference can easily point to the February table, and then the March table when it's available.

  • Overview! refers to the Overview sheet. The exclamation point always follows the name of a worksheet.
  • [REP] refers to the REP column in a table. The square brackets are what tells us we're looking at a table, not just plain cells. [Count] is the same thing, it refers to the Count column in the table.

Putting everything together. This formula allows the user to select the Rep, Month and Count level and the formula returns the number of entries for the Rep in the selected month that are greater than or equal to the Level.

Conclusion

There's a lot going on here. This challenge is about being savvy. If you can't read the formula, play with it and see what it does.

Please, ask any questions that you might have.

See you next week with the next Excel Weekly Challenge!

Anders Liu-Lindberg

Leading advisor to senior Finance and FP&A leaders on creating impact through business partnering | Interim | VP Finance | Business Finance

4y
Like
Reply
Bryan McReynolds

Devoted Husband & Father || Cub Scouts Leader || Manhattan WMOS System Analyst

4y

Love this use of INDIRECT to do a dynamic multi-criteria calculation.

Thanks for sharing Oz. Next time I come across the complex formula I'll try your approach. When I try to understand complex formulas I usually like to break it down into smaller, more "digestible" parts. I just copy the independent smaller parts of the formula in different cells to find out the output of that part. When I find out what is the output of each single part of the formula, I can then conclude what is the final output (what it does). That's when I have time to go into details. But when there's no time to spare, then I'll try to play around with the formula.

To view or add a comment, sign in

More articles by Oz du Soleil

  • Apple iOS, Facebook & Privacy

    Apple iOS, Facebook & Privacy

    Have you been paying attention to the battle Apple started when it announced that the forthcoming iOS 14.5 will require…

    16 Comments
  • My Latest Course: Excel VBA for the curious and uncommitted

    My Latest Course: Excel VBA for the curious and uncommitted

    I'm writing this article about this course because it speaks to something more broadly about learning. Have you ever…

    13 Comments
  • Excel & the Missing Covid Cases

    Excel & the Missing Covid Cases

    I've seen the articles about Excel being blamed for 15,841 lost Covid cases in England. Here's what I see: A clickbait…

    76 Comments
  • Excel Weekly Challenge: Filtering with Dynamic Arrays

    Excel Weekly Challenge: Filtering with Dynamic Arrays

    This week's challenge involves the new Dynamic Arrays function: FILTER. We want to filter a list of venues based on the…

    6 Comments
  • Excel Weekly Challenge: Find the Power Query Result

    Excel Weekly Challenge: Find the Power Query Result

    This short challenge is to find the result of a Power Query query and load it onto a worksheet. Our friend Tony insists…

    3 Comments
  • Excel Weekly Challenge: Pivot Table Prep

    Excel Weekly Challenge: Pivot Table Prep

    Back in the olden days, when I taught pivot tables in live sessions there was always a disappointed groan. This weekly…

    12 Comments
  • Extract the 7 Largest Donations (plus BONUS VIDEO!)

    Extract the 7 Largest Donations (plus BONUS VIDEO!)

    This week's challenge asks users to extract the Top 7 Donations from a list and specifically, use the LARGE function…

    9 Comments
  • Excel Weekly Challenge: Tables & Hyperlinks

    Excel Weekly Challenge: Tables & Hyperlinks

    Excel is more than formulas and pivot tables. There's a lot that we can do in Excel to customize our experience.

    11 Comments
  • Excel Weekly Challenge: COUNTIFS with Wildcards

    Excel Weekly Challenge: COUNTIFS with Wildcards

    This week's challenge is a short one: count the number of projects that contain FF2W and projects that end with W. (And…

    9 Comments
  • Excel Weekly Challenge: Dropdown Lists

    Excel Weekly Challenge: Dropdown Lists

    This week, users are challenged to create dropdown lists in order to simplify and control inputs. This is all about…

    15 Comments

Insights from the community

Others also viewed

Explore topics