63 pages
Excel how-to recipes: solve everyday tasks
Short, complete answers to the Excel tasks people search for most: counting unique values, lookups with two conditions, splitting names, working days and more. Each recipe shows the Microsoft 365 way and a way that works in older versions.
Lookups
- How to do a case-sensitive lookup in ExcelVLOOKUP, XLOOKUP and MATCH ignore upper and lower case. Combine them with EXACT to find the value whose case matches exactly.
- How to find the last value in a column in ExcelReturn the last non-empty value of a column, even with gaps, with TAKE and TOCOL or XLOOKUP in Microsoft 365, or LOOKUP(2,1/...) in older Excel.
- How to get the nth match in ExcelReturn the 2nd, 3rd or any n-th matching value instead of the first, with INDEX and FILTER in Microsoft 365 or AGGREGATE in Excel 2016 and 2019.
- How to look up a value to the left in ExcelVLOOKUP cannot return a column to the left of the search column. Use XLOOKUP in Microsoft 365 or INDEX and MATCH in Excel 2016 and 2019.
- How to look up a value with two criteria in ExcelFind a value that matches two conditions, such as rep and month, with XLOOKUP, INDEX/MATCH for Excel 2016, SUMIFS or a helper key column.
- How to return multiple matches in ExcelVLOOKUP returns only the first match. List every matching row with FILTER, join matches in one cell with TEXTJOIN, or use INDEX and AGGREGATE in older Excel.
Counting and summing
- How to calculate a running total in ExcelBuild a cumulative sum that grows row by row with SUM and a mixed reference, SCAN in Microsoft 365, or a running total per group with SUMIF.
- How to count cells by color in ExcelExcel has no COUNTIF for colours. Count coloured cells with Filter by Color and SUBTOTAL, Find All, or a short VBA function, and know each method's limits.
- How to count cells that contain text in ExcelCount cells that hold any text, or that contain a specific word anywhere, with COUNTIF wildcards, SEARCH and ISNUMBER; plus a case-sensitive version.
- How to count distinct values with criteria in ExcelCount how many different customers, products or names meet a condition, with FILTER and UNIQUE or a SUMPRODUCT formula for Excel 2016.
- How to count unique values in ExcelCount how many different values a list contains with UNIQUE and COUNTA, or with SUMPRODUCT and COUNTIF in Excel 2016 and 2019.
- How to sum by category in ExcelTotal amounts per category, product or person with GROUPBY or UNIQUE + SUMIF in Microsoft 365, SUMIF in any version, or a PivotTable.
- How to sum only visible cells in ExcelSUM adds hidden and filtered rows too. Use SUBTOTAL 109 or AGGREGATE to total only the rows you can see after filtering or hiding.
- How to sum values between two dates in ExcelAdd up amounts whose date falls between a start and an end date with SUMIFS, including the end date, plus FILTER and SUMPRODUCT alternatives.
- How to sum values by month in ExcelTotal sales or expenses per month from a list of dates with GROUPBY in Microsoft 365, SUMIFS with a date range in any version, or a PivotTable.
Text
- How to capitalize the first letter in ExcelCapitalise the first letter of every word with PROPER, or only the first letter of the text (sentence case) with UPPER, LEFT, LOWER and MID.
- How to check if a cell contains a word in ExcelTest whether a cell contains specific text with SEARCH and ISNUMBER, make it case-sensitive with FIND, check several words, or match whole words only.
- How to combine first and last name in ExcelJoin first and last names into one cell with the & operator, CONCAT or TEXTJOIN, skip empty middle names, and create Last, First formats.
- How to extract numbers from text in ExcelPull numbers out of text like "Qty: 12 boxes" with REGEXEXTRACT or a SEQUENCE formula in Microsoft 365, and with MID, FIND and LOOKUP in older Excel.
- How to extract text between two characters in ExcelPull out the text between brackets, dashes or other delimiters with TEXTBEFORE and TEXTAFTER in Microsoft 365, or MID and FIND in older Excel.
- How to split first and last name in ExcelSplit a full name into first and last name with TEXTSPLIT, TEXTBEFORE and TEXTAFTER, LEFT/FIND formulas for older Excel, Flash Fill or Text to Columns.
Dates and times
- How to add months to a date in ExcelAdd or subtract months and years from a date with EDATE, handle month-end dates correctly, and see why DATE with MONTH+n can overshoot.
- How to calculate age in ExcelCalculate someone's age in whole years from a date of birth with DATEDIF or YEARFRAC, show years, months and days, and avoid the common errors.
- How to calculate overtime in ExcelBuild a timesheet that works out daily hours, overtime above 8 hours a day or 40 a week, night shifts past midnight, and overtime pay.
- How to calculate the number of days between two dates in ExcelCount the days between two dates by subtracting them or with DAYS, include both ends, count from today, and get weeks or months instead.
- How to convert a date to text in ExcelTurn a date into text in any format with TEXT, join dates into sentences without seeing serial numbers, and use format codes for days and months.
- How to convert decimal hours to time in ExcelTurn 7.75 hours into 7:45 by dividing by 24, convert times back to decimal hours, and handle totals over 24 hours and rounding to minutes.
- How to convert text to a date in ExcelTurn dates stored as text into real Excel dates with DATEVALUE, DATE with LEFT, MID and RIGHT, or Text to Columns, and fix day-month mix-ups.
- How to count working days between two dates in ExcelCount business days between two dates excluding weekends and holidays with NETWORKDAYS, or custom weekends with NETWORKDAYS.INTL.
- How to get the first and last day of the month in ExcelFind the first and last day of any month with EOMONTH or DATE, count the days in a month, and get the first Monday or last working day.
- How to get the quarter from a date in ExcelTurn a date into its calendar quarter (1-4) or a label like Q3 2026 with ROUNDUP and MONTH, and calculate fiscal quarters that start in another month.
- How to sum time over 24 hours in ExcelAdd up hours and minutes that go beyond 24 hours with the [h]:mm number format, convert the total to decimal hours, and avoid the reset-to-zero trap.
Cleaning data
- How to remove duplicates in ExcelDelete repeated rows with Data > Remove Duplicates, keep the original intact with UNIQUE, or flag duplicates with COUNTIF in older Excel.
- How to remove line breaks in ExcelReplace line breaks inside cells with a comma or space using SUBSTITUTE and CHAR(10), CLEAN, or Find & Replace with Ctrl+J, and split lines into columns.
- How to remove spaces in ExcelRemove extra, leading, trailing or all spaces with TRIM and SUBSTITUTE, deal with non-breaking spaces from the web, and clean a column with Find & Replace.
- How to transpose rows and columns in ExcelSwitch rows to columns with Paste Special > Transpose, a live TRANSPOSE formula in Microsoft 365, or INDEX in older Excel without Ctrl+Shift+Enter.
- How to unpivot data in Excel with Power QueryTurn a wide table with one column per month into a long list with Power Query's Unpivot Columns, or with TOCOL and HSTACK in Microsoft 365.
Formatting
- How to highlight duplicates in ExcelColour repeated values with conditional formatting: the built-in Duplicate Values rule, a COUNTIF rule for second occurrences only, and whole rows.
- How to shade alternate rows in ExcelAdd zebra stripes to a list with a table style or a MOD(ROW()) conditional formatting rule, keep them after filtering, and band groups of rows.
- How to use conditional formatting with a formula in ExcelColour cells or whole rows based on your own rule, such as overdue and unpaid invoices, using a formula rule with the right $ references.
Analysis
- How to average ignoring zeros in ExcelCalculate an average that skips zero values with AVERAGEIF, AVERAGE + FILTER in Microsoft 365, and handle blanks, errors and all-zero ranges.
- How to calculate a weighted average in ExcelCalculate an average where some values count more than others, such as grades or purchase prices, with SUMPRODUCT divided by SUM.
- How to calculate CAGR in ExcelCalculate the compound annual growth rate between two values with a simple formula or the RRI function, and avoid counting the years wrong.
- How to calculate compound interest in ExcelCalculate how savings grow with compound interest using the formula P(1+r/n)^(nt) or the FV function, with regular deposits and different compounding.
- How to calculate percentage change in ExcelWork out the percentage increase or decrease between two numbers, handle zero and negative starting values, and apply a percentage change.
- How to calculate percentage of total in ExcelShow each item as a share of the total: divide by a locked SUM, use PERCENTOF in Microsoft 365, or a PivotTable's % of Grand Total.
- How to compare two columns in ExcelCompare two columns row by row: show Match or Different, count the differences, colour them, and do a case-sensitive check with EXACT.
- How to create a loan payment schedule in ExcelBuild an amortisation table showing interest, principal and balance for every payment with PMT, IPMT and PPMT, as a spilled formula or copied down.
- How to find duplicates between two lists in ExcelFind the values that appear in both lists, or only in one, with FILTER and COUNTIF in Microsoft 365 or a MATCH helper column in older Excel.
- How to list the top 5 values with names in ExcelBuild a top 5 list with names and values using TAKE and SORT in Microsoft 365, or LARGE with INDEX and MATCH in older Excel, and handle ties.
- How to pick a random sample from a list in ExcelSelect random items without repeats using SORTBY, RANDARRAY and TAKE in Microsoft 365, or RAND with a helper column in older Excel, and freeze the result.
- How to rank numbers with ties in ExcelRank scores or sales with RANK.EQ and RANK.AVG, break ties so every rank is unique, or create a dense rank (1, 2, 3 without gaps).
- How to reverse a list in ExcelFlip the order of a column or row with SORTBY and SEQUENCE or CHOOSEROWS in Microsoft 365, INDEX and ROWS in older Excel, or a helper column and Sort.
- How to use IF with multiple conditions in ExcelTest two or more conditions in one IF formula with AND, OR and NOT, combine them, and return results for a whole column in Microsoft 365.
- How to use nested IF and IFS in ExcelAssign grades, bands or tiers with nested IF, the clearer IFS function, SWITCH for exact values, or a lookup table that is easier to maintain.
Charts
- How to create a progress bar in Excel cellsShow progress inside cells with data bars from conditional formatting, or a text bar built with REPT, for task lists, targets and dashboards.
- How to make a Gantt chart with conditional formatting in ExcelBuild a simple project timeline in the grid: dates across the top, tasks down the side, and a formula rule that colours each task's days.
Workbooks and sheets
- How to convert a table to a normal range in ExcelTurn an Excel table back into a normal range with Convert to Range, see what happens to structured references, and remove the leftover table formatting.
- How to create a dependent drop-down list in ExcelMake a second drop-down that shows only the options for the first choice, with FILTER in Microsoft 365 or named ranges and INDIRECT in older Excel.
- How to create a drop-down list in ExcelAdd a drop-down list to cells with Data Validation, use a typed list, a range, a table or a sorted UNIQUE list as the source, and add input and error messages.
- How to create a dynamic named range in ExcelMake a named range that grows as you add data, with an Excel table, a spill reference, INDEX or OFFSET, for charts, drop-downs and formulas.
- How to freeze panes in ExcelKeep header rows and label columns visible while you scroll with Freeze Panes, Freeze Top Row and Freeze First Column, and fix panes that freeze the wrong area.
- How to lock formula cells in ExcelProtect formulas from being overwritten while leaving input cells editable: unlock inputs, lock formulas with Go To Special, and protect the sheet.