Admissions open Established 2003 Laxmi Nagar, Delhi

Blog

Advanced Excel Formulas: 25+ Formulas with Examples (Free PDF)

25+ advanced Excel formulas worked on one sales sheet, the Excel version each needs, and a free PDF and practice file.

  • 16 min read
  • Updated
  • 11 sources cited
Advanced Excel Formulas: 25+ Formulas with Examples (Free PDF) – IPA guide illustration

Advanced Excel formulas are the formulas that find, filter, total and reshape data on their own, so a report that takes an hour by hand updates in seconds. The core set has four groups. XLOOKUP and INDEX with MATCH handle lookups, SUMIFS and COUNTIFS handle conditional totals, and IFS and IFERROR handle logic. FILTER, UNIQUE and SORT build lists that update themselves, and LET and LAMBDA let you write your own reusable formulas.

This guide works through more than 25 of them on the same small sales sheet and shows the exact result each one returns. It also tells you which Excel version you need, because a formula your Excel doesn’t have simply shows #NAME?. You can download the sample data as a practice workbook and the full list as a one-page PDF further down.

What makes an Excel formula advanced?

A formula is “advanced” when it does one of four things a basic SUM or AVERAGE can’t:

  • It works with conditions: totals, counts or averages only for the rows that match one or more criteria (SUMIFS, COUNTIFS, MAXIFS).
  • It finds data in another table: lookups by a key such as an invoice number or an employee ID (XLOOKUP, INDEX and MATCH).
  • It returns a whole list, not one cell: the dynamic array functions FILTER, UNIQUE, SORT and SEQUENCE “spill” their results into the cells below.
  • It combines steps: nesting functions, naming parts of a formula with LET, or turning a formula into your own function with LAMBDA.

If you are still getting comfortable with cell references, percentages and SUMIF, start with our guide to Excel formulas for accounting and come back to this one.

Which Excel version do you need for each formula?

This is the step most formula lists skip. The table below is based on the “Applies to” section and notes of each function’s page on Microsoft Support (checked 16 October 2026). Where the two disagree, we follow the note: Microsoft’s XLOOKUP page, for example, lists Excel 2016 and 2019 under “Applies to” but its note says XLOOKUP is not available in them.

Function Excel 2016 Excel 2019 Excel 2021 Excel 2024 Microsoft 365
SUMIFS, COUNTIFS, INDEX, MATCH, IFERROR, EOMONTH, NETWORKDAYS Yes Yes Yes Yes Yes
IFS, SWITCH, MAXIFS, MINIFS, TEXTJOIN No Yes Yes Yes Yes
XLOOKUP, XMATCH, FILTER, UNIQUE, SORT, SORTBY, SEQUENCE, LET No No Yes Yes Yes
LAMBDA, TEXTSPLIT, TEXTBEFORE, TEXTAFTER, VSTACK, CHOOSECOLS, TAKE, DROP No No No Yes Yes
GROUPBY No No No No Yes

To check your version, open File, then Account, then About Excel. Some offices still use Excel 2016 or 2019, so for a file you share, stick to the formulas in the first two rows unless you know everyone who opens it has a newer version.

The sample data used in every example

All the examples use one small sales register on a sheet with headers in row 1 and ten invoices in rows 2 to 11. The customers are invented; the numbers are chosen so you can check each result by hand.

A: Invoice B: Date C: Customer D: Region E: Product F: Qty G: Rate (₹) H: Amount (₹)
INV-101 02-Apr-2026 Sharma Traders North Laptop 2 52,000 1,04,000
INV-102 05-Apr-2026 Gupta & Sons East Printer 3 9,500 28,500
INV-103 09-Apr-2026 Mehta Stores North Monitor 5 11,000 55,000
INV-104 12-Apr-2026 Sharma Traders West Keyboard 10 900 9,000
INV-105 18-Apr-2026 Verma Agencies South Laptop 1 52,000 52,000
INV-106 22-Apr-2026 Gupta & Sons East Monitor 2 11,000 22,000
INV-107 27-Apr-2026 Mehta Stores North Printer 1 9,500 9,500
INV-108 03-May-2026 Verma Agencies South Keyboard 15 900 13,500
INV-109 08-May-2026 Sharma Traders North Laptop 3 52,000 1,56,000
INV-110 14-May-2026 Kapoor & Co West Monitor 4 11,000 44,000

Column H is =F2*G2 copied down, and the ten amounts add up to ₹4,93,500.

Lookup formulas: XLOOKUP, INDEX and MATCH, XMATCH

Lookups pull a value from a table using a key, such as fetching an invoice amount from its number. They are the formulas interviewers ask about most.

XLOOKUP

XLOOKUP is Excel’s newer lookup function: it searches one column for a value and returns the matching value from another. =XLOOKUP("INV-106",A2:A11,H2:H11,"Not found") returns 22,000, the amount of invoice INV-106. The fourth argument is the text shown when the invoice doesn’t exist, so you don’t need a separate IFERROR.

XLOOKUP can also return several columns at once: =XLOOKUP("INV-106",A2:A11,C2:E11) spills Gupta & Sons, East, Monitor into three cells side by side. Unlike VLOOKUP, the return column can be to the left of the lookup column, and inserting a column doesn’t break the formula. Syntax and options are on Microsoft’s XLOOKUP page.

INDEX and MATCH

For files that must open in Excel 2016 or 2019, INDEX with MATCH does the same job: =INDEX(H2:H11,MATCH("INV-106",A2:A11,0)) also returns 22,000. MATCH finds the row position (6), and INDEX returns the value in that position. The 0 asks for an exact match; leave it out and you can get wrong answers on unsorted data.

A two-way lookup uses one MATCH for the row and one for the column. =INDEX(A2:H11,MATCH("INV-103",A2:A11,0),MATCH("Qty",A1:H1,0)) returns 5, the quantity on invoice INV-103, and keeps working if someone reorders the columns.

XMATCH

XMATCH returns a position like MATCH but can search from the bottom. =XMATCH("Monitor",E2:E11) returns 3 (the first Monitor, INV-103), while =XMATCH("Monitor",E2:E11,0,-1) returns 10 (the last one, INV-110). Searching from the bottom is how you find the latest entry for an item in a register.

VLOOKUP vs XLOOKUP vs INDEX and MATCH

All three find a value by key. The difference is how safely they do it:

Point VLOOKUP INDEX and MATCH XLOOKUP
Return column to the left of the key No Yes Yes
Breaks if a column is inserted Yes, the column number goes stale No No
Exact match by default No, you must add FALSE or 0 No, you must add 0 to MATCH Yes
Built-in “not found” value No, needs IFERROR No, needs IFERROR Yes
Search from the bottom No No (XMATCH can) Yes
Excel 2016 and 2019 Yes Yes No

In practice: use XLOOKUP when everyone has Excel 2021 or later, INDEX and MATCH when the file must open in older versions, and read VLOOKUP when you inherit it.

Conditional totals: SUMIFS, COUNTIFS, MAXIFS, AVERAGEIFS, SUMPRODUCT

These answer questions like “how much did the North region sell in April?” without a filter or a pivot table.

SUMIFS with two conditions

=SUMIFS(H2:H11,D2:D11,"North",E2:E11,"Laptop") returns 2,60,000: the two North laptop invoices, INV-101 and INV-109. The first range is what you add up; after that come pairs of range and condition, and a row is counted only if it meets every condition.

SUMIFS between two dates

To total a period, use the date column twice: =SUMIFS(H2:H11,D2:D11,"North",B2:B11,">="&DATE(2026,4,1),B2:B11,"<="&DATE(2026,4,30)) returns 1,68,500, North’s April sales. Joining the operator to DATE() with & avoids the date-format mistakes that come from typing “01/04/2026” inside quotes.

COUNTIFS, MAXIFS and AVERAGEIFS

  • =COUNTIFS(H2:H11,">=50000") returns 4: the invoices of ₹50,000 or more.
  • =MAXIFS(H2:H11,D2:D11,"East") returns 28,500: the largest East invoice. MINIFS works the same way for the smallest.
  • =AVERAGEIFS(H2:H11,E2:E11,"Monitor") returns 40,333.33: the average of the three Monitor invoices.

SUMPRODUCT

SUMPRODUCT multiplies ranges row by row and adds the results, so it can calculate and filter in one step. =SUMPRODUCT((E2:E11="Laptop")*F2:F11*G2:G11) returns 3,12,000: quantity times rate for laptop rows only, without needing the Amount column. The comparison in brackets returns 1 for matching rows and 0 for the rest, which is what does the filtering.

Logic formulas: IFS, SWITCH, IFERROR

IFS instead of nested IF

=IFS(H2>=100000,"Large",H2>=25000,"Medium",TRUE,"Small") labels each invoice by size. For row 2 (₹1,04,000) it returns Large; copied down, INV-102 (₹28,500) is Medium and INV-104 (₹9,000) is Small. Conditions are checked in order, so put the biggest threshold first, and end with TRUE as the catch-all.

SWITCH for exact matches

When you are matching one cell against a fixed list, SWITCH is shorter: =SWITCH(D2,"North","N-01","South","S-01","East","E-01","West","W-01","Unknown") turns region names into branch codes and returns N-01 for row 2. The last argument is the default when nothing matches.

IFERROR

IFERROR replaces an error with a value of your choice. =IFERROR(H2/F2,0) returns the rate per unit, or 0 if the quantity cell is empty. Use it carefully: it hides every error, including real mistakes, so in a lookup prefer XLOOKUP’s own “if not found” argument, which only catches missing keys.

Dynamic array formulas: FILTER, UNIQUE, SORT, SEQUENCE

Dynamic array formulas are formulas that return a list which “spills” into the cells below or beside the formula. You type the formula in one cell, and the result grows or shrinks when the data changes. If the cells in the way are not empty, Excel shows #SPILL! instead; clear them and the result appears. Microsoft’s guide to dynamic array formulas and spilled array behaviour explains the rules.

FILTER

=FILTER(A2:H11,C2:C11="Sharma Traders","No sales") returns the three Sharma Traders invoices, INV-101, INV-104 and INV-109, with all eight columns. For two conditions, multiply them: =FILTER(A2:H11,(D2:D11="North")*(H2:H11>=50000)) returns INV-101, INV-103 and INV-109. Always fill in the third argument: according to Microsoft’s FILTER page, an empty result without it gives a #CALC! error.

UNIQUE

=UNIQUE(C2:C11) returns the five customers, each once: Sharma Traders, Gupta & Sons, Mehta Stores, Verma Agencies, Kapoor & Co. Wrap it in COUNTA to count them: =COUNTA(UNIQUE(C2:C11)) returns 5. This replaces Remove Duplicates, which changes your data, with a list that updates itself.

SORT and SORTBY

=SORT(A2:H11,8,-1) returns the whole table sorted by column 8 (Amount) from largest to smallest, starting with INV-109 (₹1,56,000). SORTBY sorts one range by another: =SORTBY(C2:C11,H2:H11,-1) lists the customer of each invoice from the largest sale down, without showing the amounts.

SEQUENCE

SEQUENCE generates a list of numbers. =SEQUENCE(12) returns 1 to 12 down a column. Combined with DATE, it builds a month list for a financial year: =DATE(2026,3+SEQUENCE(12),1) returns the first day of each month from 1 April 2026 to 1 March 2027 (format the cells as dates). DATE rolls month 13 over into January of the next year, which is why this works.

Text formulas: TEXTJOIN, TEXTSPLIT, TEXTBEFORE, TEXTAFTER, TRIM

Text formulas clean and combine the messy data you get from bank statements and software exports.

  • TEXTJOIN: =TEXTJOIN(", ",TRUE,UNIQUE(FILTER(C2:C11,D2:D11="North"))) returns Sharma Traders, Mehta Stores: every North customer, once, in one cell. TRUE skips empty cells.
  • TEXTSPLIT: if J2 holds a bank narration such as NEFT/UTR12345/SHARMA TRADERS, =TEXTSPLIT(J2,"/") spills NEFT, UTR12345, SHARMA TRADERS into three cells.
  • TEXTBEFORE and TEXTAFTER: =TEXTBEFORE(J2,"/") returns NEFT, and =TEXTAFTER(J2,"/",-1) returns SHARMA TRADERS; the -1 means “after the last slash”.
  • TRIM and CLEAN: =TRIM(CLEAN(A2)) removes extra spaces and non-printing characters, a common reason two values that look the same don’t match in a lookup.

Date formulas: EOMONTH, EDATE, NETWORKDAYS

  • EOMONTH: =EOMONTH(B5,0) returns 30-Apr-2026, the last day of the month of INV-104 (12 April). Use 1 for the next month-end, -1 for the previous one. Month-end dates are what you group sales and dues by.
  • EDATE: =EDATE(B5,1) returns 12-May-2026, the same day one month later, which suits monthly due dates. For a due date in days, simply add: =B5+30 also gives 12-May-2026 here, because April has 30 days.
  • NETWORKDAYS: =NETWORKDAYS(DATE(2026,4,1),DATE(2026,4,30)) returns 22, the Monday-to-Friday days in April 2026. Add a range of holiday dates as the third argument to exclude them too.

Reshaping data: VSTACK, CHOOSECOLS, TAKE and DROP

These newer functions (Excel 2024 and Microsoft 365) rearrange whole tables with a formula, which used to need copy and paste or Power Query.

  • VSTACK: =VSTACK(April!A2:H8,May!A2:H4) stacks the April and May sheets into one list. Change either sheet and the combined list updates.
  • CHOOSECOLS: =CHOOSECOLS(A2:H11,1,3,8) returns only Invoice, Customer and Amount, in that order.
  • TAKE: =TAKE(SORT(A2:H11,8,-1),3) returns the top three invoices by amount: INV-109, INV-101 and INV-103. A negative number takes from the bottom.
  • DROP: =DROP(A1:H11,1) removes the header row, handy before stacking several tables.

LET and LAMBDA: name parts of a formula and build your own

LET

LET is a function that gives names to parts of a formula, so a long formula reads like a sentence and repeated parts are calculated once. =LET(amt,H2:H11,north,D2:D11="North",SUM(FILTER(amt,north))) returns 3,24,500, total North sales. Each name is followed by its value, and the last argument is the calculation that uses them.

LAMBDA

LAMBDA is a function that turns a formula into a function you can reuse by name. In Formulas, then Name Manager, create a name such as NETPRICE that refers to =LAMBDA(price,disc,price*(1-disc)). After that, =NETPRICE(G2,10%) returns 46,800, the laptop rate after a 10% discount. The calculation lives in one place, so changing it updates every cell that uses it. The rules are on Microsoft’s LAMBDA page.

GROUPBY: a summary table without a pivot table

GROUPBY (Microsoft 365) summarises data with a single formula. =GROUPBY(D2:D11,H2:H11,SUM) returns sales by region with a grand total, which is the default according to Microsoft’s GROUPBY page:

Region Sales (₹)
East 50,500
North 3,24,500
South 65,500
West 53,000
Total 4,93,500

Unlike a pivot table, it recalculates the moment the data changes, with no Refresh. For drag-and-drop summaries with filters and slicers, a pivot table is still the better tool; our guide to pivot tables in Excel covers it.

Advanced Excel formulas list: one-page summary

Formula What it does Example on the sample sheet Result
XLOOKUP Finds a value by key =XLOOKUP("INV-106",A2:A11,H2:H11,"Not found") 22,000
INDEX + MATCH Lookup that works in every version =INDEX(H2:H11,MATCH("INV-106",A2:A11,0)) 22,000
XMATCH Position, from the top or bottom =XMATCH("Monitor",E2:E11,0,-1) 10
SUMIFS Total with conditions =SUMIFS(H2:H11,D2:D11,"North",E2:E11,"Laptop") 2,60,000
COUNTIFS Count with conditions =COUNTIFS(H2:H11,">=50000") 4
MAXIFS Largest value with conditions =MAXIFS(H2:H11,D2:D11,"East") 28,500
AVERAGEIFS Average with conditions =AVERAGEIFS(H2:H11,E2:E11,"Monitor") 40,333.33
SUMPRODUCT Multiply and add with a filter =SUMPRODUCT((E2:E11="Laptop")*F2:F11*G2:G11) 3,12,000
IFS Several conditions in order =IFS(H2>=100000,"Large",H2>=25000,"Medium",TRUE,"Small") Large
SWITCH Match a value against a list =SWITCH(D2,"North","N-01","South","S-01","Unknown") N-01
FILTER Rows that meet conditions =FILTER(A2:H11,C2:C11="Sharma Traders","No sales") 3 rows
UNIQUE Distinct list =COUNTA(UNIQUE(C2:C11)) 5
SORT Sorted copy of a table =SORT(A2:H11,8,-1) INV-109 first
SEQUENCE List of numbers or dates =DATE(2026,3+SEQUENCE(12),1) Apr 2026 to Mar 2027
TEXTJOIN Join text with a separator =TEXTJOIN(", ",TRUE,UNIQUE(FILTER(C2:C11,D2:D11="North"))) Sharma Traders, Mehta Stores
TEXTSPLIT Split text into cells =TEXTSPLIT(J2,"/") 3 cells
EOMONTH Month-end date =EOMONTH(B5,0) 30-Apr-2026
NETWORKDAYS Working days between dates =NETWORKDAYS(DATE(2026,4,1),DATE(2026,4,30)) 22
TAKE Top or bottom rows =TAKE(SORT(A2:H11,8,-1),3) Top 3
LET Name parts of a formula =LET(amt,H2:H11,north,D2:D11="North",SUM(FILTER(amt,north))) 3,24,500
GROUPBY Summary by group =GROUPBY(D2:D11,H2:H11,SUM) Sales by region

Common formula errors and how to fix them

Error What it usually means Fix
#N/A A lookup didn’t find the key Check for extra spaces (TRIM) or numbers stored as text; use XLOOKUP’s “if not found” argument
#NAME? Excel doesn’t recognise the function name Check spelling, or your Excel version: FILTER in Excel 2019 shows #NAME?
#SPILL! A dynamic array result is blocked Clear the cells where the result needs to spill
#CALC! FILTER found nothing and has no “if empty” value Add the third argument, such as “No sales”
#VALUE! Text where Excel expects a number or date Convert text dates and numbers, for example with Text to Columns
#REF! A referenced cell or column was deleted Undo, or rebuild the reference; INDEX and MATCH and XLOOKUP survive column changes better than VLOOKUP

Practice exercises (with answers)

Try these on the practice workbook before looking at the answers. Each one is answered by a formula from this page.

  1. Total sales to Gupta & Sons. Answer: =SUMIFS(H2:H11,C2:C11,"Gupta & Sons") returns 50,500.
  2. How many Monitor invoices are there? Answer: =COUNTIFS(E2:E11,"Monitor") returns 3.
  3. The customer on the largest invoice. Answer: =XLOOKUP(MAX(H2:H11),H2:H11,C2:C11) returns Sharma Traders.
  4. All invoices from May. Answer: =FILTER(A2:H11,MONTH(B2:B11)=5,"None") returns INV-108, INV-109 and INV-110.
  5. Total quantity of keyboards sold. Answer: =SUMIFS(F2:F11,E2:E11,"Keyboard") returns 25.

Download the PDF and the practice workbook

Two free files go with this guide:

  • Advanced Excel formulas cheat sheet (PDF): the one-page list above with syntax and the version table, to print or keep on your phone.
  • Practice workbook (Excel file): the sample sales sheet, every example formula from this page with the result it should return, and the five exercises. Type each formula yourself and check your answer against the expected result.

The newer formulas need Excel 2021 or later (some need Excel 2024 or Microsoft 365); in an older version they show #NAME?, which is itself a quick way to check what you have.

Where these formulas are used at work

In accounts and MIS jobs, a handful of these do most of the work:

  • Accounts: XLOOKUP or INDEX and MATCH to match a purchase register with supplier statements, SUMIFS for party-wise and month-wise totals, and EOMONTH for ageing.
  • MIS reporting: FILTER, UNIQUE and SORT for self-updating lists, and SUMIFS or GROUPBY for summary sheets. Our guide to the MIS course and MIS executive jobs explains the role.
  • Interviews: employers often give a short Excel test with a lookup, a conditional total and a pivot table. See our accounting interview questions for the rest of the round.

If you want to learn with a trainer, IPA’s Advanced Excel course in Laxmi Nagar, Delhi covers lookups (VLOOKUP and INDEX-MATCH), IF logic, COUNTIF and SUMIF, pivot tables, Power Query, dashboards, and macros with VBA.

Frequently asked questions

What are the most important advanced Excel formulas?

XLOOKUP (or INDEX with MATCH), SUMIFS, COUNTIFS, IFS, IFERROR, FILTER, UNIQUE and SORT cover most job tasks. Add LET and LAMBDA once those feel easy.

Is VLOOKUP still used?

Yes, in many older files, so you should be able to read it. For new work, XLOOKUP is simpler and safer, and INDEX with MATCH is the choice when the file must open in Excel 2016 or 2019.

Why does my formula show #NAME?

Usually because your Excel version doesn’t have that function. FILTER, UNIQUE, SORT, XLOOKUP and LET need Excel 2021 or later; check the version table above.

What is the difference between a formula and a function?

A function is a built-in calculation such as SUMIFS. A formula is anything you type after an equals sign, which can combine several functions, references and operators, such as =SUMIFS(H2:H11,D2:D11,”North”)/1000.

How long does it take to learn advanced Excel formulas?

With daily practice, the core set on this page takes a few weeks to use comfortably. The fastest way is to rebuild each example on your own data instead of only reading it.

Do I need advanced Excel for an accounts job?

Most accounts and MIS roles test at least lookups, conditional totals and pivot tables. Accounting software such as Tally records the entries, and Excel is where the reports, reconciliations and checks are usually done.

Who checked this guide

  • Reviewed by

    Rahul Sharma

    CA · 5 years of experience

    Reviews all of IPA's blog guides

Meet all of IPA's faculty

This guide is written by IPA, an accounting and taxation institute in Laxmi Nagar, Delhi since 2003; About IPA tells you who teaches here. We cite the official rule behind every tax point and keep dates current. Spotted something out of date? Just contact the institute and we'll check it.

Sources

Tax rules and filing dates change often. These are the official sources we used, so check the portal for the latest date before you rely on one.

  1. Microsoft Support: XLOOKUP function (note: not available in Excel 2016 and 2019)
  2. Microsoft Support: FILTER function (#CALC! when no result and no if_empty)
  3. Microsoft Support: Dynamic array formulas and spilled array behavior
  4. Microsoft Support: LET function (Excel 2021, 2024, Microsoft 365)
  5. Microsoft Support: LAMBDA function (Excel 2024, Microsoft 365)
  6. Microsoft Support: TEXTSPLIT function (Excel 2024, Microsoft 365)
  7. Microsoft Support: VSTACK function (Excel 2024, Microsoft 365)
  8. Microsoft Support: GROUPBY function (Microsoft 365; grand totals by default)
  9. Microsoft Support: MAXIFS function (Excel 2019 and later)
  10. Microsoft Support: IFS function (Excel 2019 and later)
  11. Microsoft Support: TEXTJOIN function (Excel 2019 and later)

Learn to do this properly

Tell us which courses you are choosing between, and we’ll honestly say which one fits, even if it’s none of them.

9213855555

Enquire about a course

Leave your name and number and the institute will call you back.