Intermediate Excel Functions
Listen to this lesson
Nigerian voice narration
Fictional training case. Kola & Sons Ventures keeps a sales register with product codes, but the manager wants to see product names and prices beside each sale. You also need to combine first and last names, extract the year from order dates, clean supplier codes and return 'Not found' instead of an ugly error. This module teaches the lookup and text functions that make a register usable by people who do not memorise codes.

Introduction and learning objectives
This lesson covers the intermediate functions that turn raw records into readable information: VLOOKUP and XLOOKUP, INDEX and MATCH, IFERROR, TEXT and DATE functions, LEFT, RIGHT and MID, CONCAT and TEXTJOIN, and formulas with multiple conditions. By the end you should be able to join data from two tables, clean text, format dates and build a formula that fails gracefully.

Try it yourself — step by step
- In K1 type Product name.
- In K2 type =XLOOKUP(D2,Products!$A$2:$A$7,Products!$B$2:$B$7).
- Copy the formula down the sales rows.
- Check that P001 returns Rice 50kg and P004 returns Cooking Oil 5L.
Lookups: VLOOKUP and XLOOKUP
A lookup finds a value in one table and returns a related value from another. =VLOOKUP(A2,Products!A:C,2,FALSE) looks for the code in A2, searches the first column of Products!A:C, returns column 2 and requires an exact match. XLOOKUP is simpler and safer: =XLOOKUP(A2,Products!A:A,Products!B:B,"Not found"). It does not need a column number, can look to the left and has a built-in fallback. Excel web supports XLOOKUP in current versions; if your version does not, use INDEX and MATCH.
INDEX and MATCH
INDEX returns a value at a given position; MATCH finds the position of a value. Together they make a flexible lookup: =INDEX(Products!B:B,MATCH(A2,Products!A:A,0)) returns the product name where the code matches, and the final 0 means exact match. The pair works in older Excel versions, can look in any direction and is less fragile than VLOOKUP when columns are inserted. Read it as: find the row with MATCH, then return the value at that row with INDEX.

Try it yourself — step by step
- In K1 type Lookup check.
- Type =IFERROR(XLOOKUP("P999",Products!$A$2:$A$7,Products!$B$2:$B$7),"Code not found").
- Press Enter and read the green message.
- Try a real code in place of P999 to confirm the lookup still works.
Clean errors with IFERROR
Lookups return #N/A when a code is missing. Wrap the formula: =IFERROR(XLOOKUP(A2,Products!A:A,Products!B:B),"Not found"). For a blank result, use "" instead of text. IFERROR also catches #DIV/0! and #VALUE!. Use it where a missing value is expected and you have decided what the reader should see. Do not wrap every formula just to hide a problem: if a total is wrong, a blank total hides a real error. Investigate first, then decide the fallback.
TEXT and DATE functions
Dates in Excel are stored as numbers, which is why formatting matters. =TEXT(A2,"DD/MM/YYYY") displays a date in a chosen format, while =TEXT(F2,"₦#,##0") displays a number with a currency pattern. =YEAR(A2), =MONTH(A2) and =DAY(A2) extract parts of a date. =EOMONTH(A2,0) gives the last day of the month and =EDATE(A2,1) adds one month. Use =DATEDIF(start,end,"d") for days between dates, or simply subtract one date from another and format the result as a number.
LEFT, RIGHT, MID and text cleaning
=LEFT(A2,3) returns the first three characters, useful for a code prefix. =RIGHT(A2,4) returns the last four, useful for a year suffix. =MID(A2,5,3) starts at character 5 and returns three characters. =LEN(A2) counts characters, =TRIM(A2) removes extra spaces and =PROPER(A2) capitalises each word. Combine them for cleaning: =PROPER(TRIM(C2)) fixes ' ADMIN ' to 'Admin'. Text functions return text, so a numeric code may need =VALUE() before calculation.

Build the prompt from three phrases — Role, Task and Format — and watch the AI answer.
CONCAT and TEXTJOIN
=CONCAT(A2," ",B2) joins first and last names. =TEXTJOIN(", ",TRUE,C2:E2) joins a range with a separator and ignores empty cells. Use TEXTJOIN when you do not know how many cells will be filled. The ampersand does the same job for a few cells: =A2&" "&B2. When joining numbers or dates, wrap them in TEXT() so the result looks right: =A2&" — "&TEXT(F2,"₦#,##0"). Avoid joining confidential fields into a single cell that may be shared carelessly.
Multiple conditions and combining functions
SUMIFS and COUNTIFS handle several conditions: =SUMIFS(Sales!F:F,Sales!C:C,"Jos",Sales!D:D,"Rice"). For a lookup with two keys, XLOOKUP can concatenate them: =XLOOKUP(A2&B2,Products!A:A&Products!B:B,Products!C:C). In older Excel this needs Ctrl+Shift+Enter as an array formula, so prefer a helper column. Combine text and lookup functions to produce readable labels, for example =XLOOKUP(A2,Products!A:A,Products!B:B)&" — "&TEXT(XLOOKUP(A2,Products!A:A,Products!C:C),"₦#,##0").

Try it yourself — step by step
- Add Product with =XLOOKUP(D2,Products!$A$2:$A$7,Products!$B$2:$B$7).
- Add Invoice year with =TEXT(A2,"yyyy").
- Add Rep code with =LEFT(B2,3)&"-"&RIGHT(B2,4).
- Add Customer label with =CONCAT(C2," / ",E2).
Step-by-step: enrich a sales register
1) Open the sales register and the product list on separate sheets. 2) In the first blank column type =XLOOKUP(A2,Products!A:A,Products!B:B,"Not found"). 3) In the next column look up the unit price. 4) Add =IFERROR(D2*E2,0) for line total. 5) Add a month column with =TEXT(A2,"mmm"). 6) Add a clean supplier label with =TEXTJOIN(" - ",TRUE,B2,C2). 7) Copy each formula down to the last row. 8) Check five random rows against the product list manually. 9) Sort by product name and confirm no #N/A remains unexplained.
Common mistakes to avoid
The classic VLOOKUP mistake is forgetting FALSE for an exact match, which returns a plausible but wrong value. Others include looking up a number against text codes, using a fixed column number that breaks when a column is inserted, wrapping every formula in IFERROR so real errors disappear, and copying a lookup without locking the table range. With dates, do not type them as text; use real dates and format them. Always verify a sample of lookup results against the source table.
Practice exercise
Using the downloadable sales register and the product list, add product name, unit price and line total columns. Add a month column with TEXT, a clean label with TEXTJOIN and an IFERROR fallback for missing product codes. Test at least three missing codes, then write one sentence explaining how you would investigate a missing code before reporting the total.
Lesson summary
Use XLOOKUP or INDEX and MATCH to join tables, IFERROR to handle expected missing values, TEXT and DATE functions to present dates and numbers, LEFT/RIGHT/MID/TRIM/PROPER to clean text, and CONCAT/TEXTJOIN to build labels. Combine functions carefully and verify a sample against the source before trusting a whole column.
Open Microsoft Copilot (free tier) and paste this prompt there. Strong on XLOOKUP, TEXTJOIN and IFERROR syntax you can test in Excel.
You are an Excel lookup coach for a Nigerian trading company. Write an XLOOKUP that returns a product name and price from a product table using a product code the formula first, then each argument explained, including a fallback for missing codes.
Why this tool: Strong on XLOOKUP, TEXTJOIN and IFERROR syntax you can test in Excel.
Hit a free limit? Switch to ChatGPT or Gemini and continue — the prompt works in any assistant.
Answer all three questions and check your answers to unlock the next lesson. Pass mark: 2 of 3.
In VLOOKUP, the final argument FALSE means…
INDEX and MATCH are useful because they…
TEXTJOIN is better than CONCAT when…
