Articles: Formulas

← All articles

How to replace Excel's DATEDIF function

Excel's DATEDIF function is widely used for calculating the difference between two dates in years, months, or days, but it will silently return buggy results in specific cases. DATEDIF2 is a custom LAMBDA function that replaces DATEDIF with reliable date arithmetic. This article explains the problems with DATEDIF, walks through the DATEDIF2 formula step by step, and shows where the two functions differ.

Modeling the 4 Percent Retirement Rule in Excel

The 4% retirement rule suggests you can safely withdraw 4% of your portfolio in year one of retirement, then adjust that amount for inflation each year for 30 years without running out of money. But how does this actually play out year by year? This article builds a complete Excel model to find out, exploring three different approaches, from classic row-by-row formulas to modern dynamic arrays to a single formula that generates the entire 30-year schedule. These models are fully functional, so you can play with the inputs and see how things work yourself.

Native checkboxes in Excel

If you've ever tried to create a to-do list, survey, or any kind of checklist in Excel, you've probably wished for a simple checkbox feature. Well, your wish has finally come true. Microsoft has finally introduced a native checkbox feature in Excel. It's easy to use and a great way to make your spreadsheets more interactive.

Why some Excel functions won't spill

Ever wonder why some Excel functions stubbornly refuse to spill results into multiple cells, even when you give them a range of data? For example, if you give some functions like EOMONTH or EDATE a range of dates, you'll get back a #VALUE! error. This quirky behavior affects dozens of Excel functions, mostly legacy functions from the old Analysis ToolPak, that were developed decades before dynamic array formulas were introduced. The good news? There's an incredibly simple fix that most Excel users don't know about: just add a plus sign (+) before your range reference. That's it! Read below for a full explanation, examples of how to fix the problem, and a list of functions that are affected.

Floating Point Errors in Excel

Have you ever had Excel tell you two numbers are different when they look the same? This can be quite unsettling. You keep checking and re-checking numbers that look identical, and yet Excel insists they are different. Is Excel broken? Do you need glasses? Don't worry, it's not your fault. You may have run into a floating-point error. There are reasons why this can happen, and simple ways to fix the problem.

Regular Expressions in Excel

After decades of waiting, Excel finally supports Regular Expressions, aka regex! Learn how three powerful new functions - REGEXTEST, REGEXREPLACE, and REGEXEXTRACT - can transform complex text operations into elegant, maintainable formulas. Whether you're cleaning data, validating inputs, or extracting patterns, these new tools will change how you write advanced formulas in Excel.

Complex Numbers in Excel

Excel has supported the complex number system for years. Engineers use it to solve problems related to electronics, fluid dynamics, and signal processing. The way Excel's formula engine implements complex numbers is an example of functional programming, a paradigm that Microsoft has invested heavily in recently with the latest updates and functions.

New Excel Functions

Nearly 50 new functions have been added to Excel! This is not your Dad's Excel anymore – a lot has changed. This article takes a quick tour of the new functions, with links to more detailed information.

XLOOKUP vs INDEX and MATCH

For many years, INDEX and MATCH have been the go-to solution for difficult lookup problems in Excel. While more complicated to configure, the two-function combination of INDEX + MATCH is flexible and powerful. But now that XLOOKUP is more widely available, will INDEX and MATCH remain popular? Is there any reason to still use INDEX and MATCH? Read below for a detailed comparison. See INDEX and MATCH Two-Column Lookup Example

XLOOKUP vs VLOOKUP

For many years, VLOOKUP has reigned supreme as the most widely used lookup function in Excel. But now that XLOOKUP is more widely available, VLOOKUP's reign will likely come to an end. XLOOKUP is a modern replacement for the VLOOKUP function and is more capable in almost every way. Let's look at how these two functions stack up against each other.

Why SUMPRODUCT?

In this article, I attempt to explain why you see SUMPRODUCT so often in formulas, and when you can use the SUM function instead. The short version: SUMPRODUCT supports array operations natively, which makes it very useful for solving seemingly unrelated Excel problems. In the current version of Excel, you can use the SUM function instead, but SUMPRODUCT is better for backwards compatibility.

How to concatenate in Excel

This article explains how to concatenate manually with the ampersand operator (&) and with the three Excel functions designed for concatenation: CONCATENATE, CONCAT, and TEXTJOIN.

What is an array formula?

In the world of Excel formulas, the term "array formula" is probably responsible for more confusion than just about any other concept. This is because the definition of an array formula has become mixed up with the requirement to enter some array formulas in a special way, with control + shift + enter.

Excel's RACON functions

There are eight widely used functions in Excel that use a syntax different from other functions in Excel. This syntax can make these functions more challenging to use, because it is not intuitive. Read on for important information about COUNTIF, COUNTIFS, SUMIF, SUMIFS, AVERAGEIF, AVERAGEIFS, MINIFS, and MAXIFS.

Alternatives to Dynamic Array Functions

Dynamic Excel offers 6 brand new functions that solve hard problems in Excel like sorting, filtering, and working with unique values. For those not using Office 365, this page provides some alternative formulas that work in older versions of Excel.

Dynamic array formulas in Excel

Dynamic Arrays are the biggest change to Excel formulas in years. Maybe the biggest change ever. This is because Dynamic Arrays let you easily work with multiple values at the same time in a formula. This article provides an overview with many links and examples.

Excel Formula Errors

Formula errors are useful because they tell you clearly that something is wrong in a worksheet. This guide shows examples of each of the Excel formula errors you might run into and provides information on how to investigate and correct the error. It also explains two methods to quickly find errors in a worksheet or workbook.

How to lookup first and last match

If VLOOKUP finds more than one match, will you get the first match or the last match? It's a trick question. It depends :) This article explains this confusing topic in detail, with lots of examples.

Excel formulas and functions

Most people never receive proper Excel training and spend years frustrated by the simplest tasks, especially tasks that involve formulas. To use Excel with confidence, you must have a good understanding of formulas and functions. This article introduces the basic concepts you need to know to be proficient with formulas in Excel.

101 Excel Functions you should know

Excel contains over 500 functions, with more functions added every year. That is a huge number, so where should you start? This guide provides a walkthrough of over 100 important functions in Excel with many examples and links. Click function names for details and more examples.

How to use formula criteria (50 examples)

Criteria are a key concept in Excel, but building useful criteria for text, numbers, dates, times, etc. is hard because it requires a good understanding of how Excel handles data. This guide will help you build formulas that work the first time with over 50 examples.

Excel shows formula but not result

Have you entered a formula, but Excel is not showing a result? This can be very confusing, and you might think you've somehow broken your spreadsheet. However, it's likely a simple problem. With a little troubleshooting, you can get things working again.

29 ways to save time with Excel formulas

Working with formulas takes time, and too often a problem that seems simple ends up taking far too long. In this article, I share tips that will save you time when working with formulas in Excel.

How to use INDEX and MATCH

INDEX and MATCH is the most popular tool in Excel for performing more advanced lookups. This is because INDEX and MATCH are incredibly flexible – you can do horizontal and vertical lookups, 2-way lookups, left lookups, case-sensitive lookups, and even lookups based on multiple criteria. If you want to improve your Excel skills, INDEX and MATCH should be on your list. See below for many examples.

How to make dependent dropdown lists in Excel

One of the most useful features of data validation is the ability to create a dropdown list that let users select a value from a predefined list. But how can you make one dropdown dynamically respond to another? In other words, how can you make the values in a dropdown list depend on another value in the worksheet? Read on to see how to create dependent dropdown lists in Excel.

Excel Data Validation Guide

Data validation can help control what a user can enter into a cell. You can use data validation to make sure a value is a number, a date, or to present a dropdown menu with predefined choices to a user. This guide provides an overview of the data validation feature, with many examples.

Formula to list weekends only

Sure, you can use a complicated WEEKDAY formula to generate a list of weekends. But with WORKDAY.INTL, you can do the same thing with a WAY simpler formula. The trick is to use a special 7-digit "mask" to filter out all dates except weekends.

Build friendly messages with concatenation

In this article, we explain how to use concatenation to display friendly and useful messages in your spreadsheets. The messages are dynamic and respond instantly to changes, so the effect is polished and professional.

The EOMONTH function - Formula Friday

The EOMONTH function is one of those little gems in Excel that can save you a lot of trouble. It's a simple function that does just one thing: given a date, it returns the last day of a month. You can use EOMONTH to build all kinds of useful Excel formulas.

CONCAT & TEXTJOIN

The CONCAT and TEXTJOIN functions make it possible to join values together in a range of cells. Since a range is just an array, this opens the door to some interesting new formulas that loop through values.

Named Ranges in Excel

Named ranges make formulas easier to read, faster to develop, and more portable. They're also useful for data validation, hyperlinks, and dynamic ranges. This article shows you how you can use named ranges to build better spreadsheets, and better formulas.

Replace ugly IFs with MAX or MIN

In this article, we show you how to replace a complicated IF statement with a clever and compact formula based on MIN or MAX. This is a great tip any time you need to choose the smaller or greater of two values inside a formula.

Conditional formatting with formulas

Although Excel ships with many conditional formatting "presets", these are limited. A more powerful way to apply conditional formatting is with formulas, because formulas allow you to apply rules that use more sophisticated logic. This article shows 10 examples, including how to highlight rows, column differences, missing values, and how to build Gantt charts and search boxes with conditional formatting.

19 tips for nested IF formulas

Are nested IFs evil? Are they necessary? Are there alternatives? The answer is Yes! This in-depth article explores nested IF formulas in detail, with lots of tips, and several alternatives.

How to find text with a formula

Does cell A1 contain "apple"? This is a surprisingly tricky problem in Excel. In this article, we look at several options, based on the functions FIND, SEARCH, ISNUMBER, and COUNTIF.

Top 10 reasons to learn Excel formulas

If you've ever wondered whether learning Excel formulas is worth your time, this list is for you. Formulas are the glue that hold spreadsheets together all over the world, and your skill with them can help you in many ways.

23 things you should know about VLOOKUP

Although VLOOKUP is a pretty simple function, there is plenty that can go wrong. Quickly learn more than 20 things you should know about VLOOKUP to make your experience pleasant and profitable.

Danger: beware VLOOKUP defaults

Many users aren't aware of it, but VLOOKUP will use approximate match mode by default. This can be a disaster because VLOOKUP can return a totally incorrect result. Read below to learn how match modes work in VLOOKUP, and how to avoid this dangerous problem.