Skip to content

Excel: Formulas Reference Guide

Useful Excel formulas and functions for data manipulation, analysis, and automation.

=IF(ISNUMBER(SEARCH("ccc", A1)), "TRUE", "FALSE")
  • SEARCH is case-insensitive
  • Returns position if found, error if not
  • ISNUMBER checks if SEARCH succeeded
  • Use FIND for case-sensitive search
=CONCAT(A1, " ", B1)

Alternative methods:

=A1 & " " & B1
=TEXTJOIN(" ", TRUE, A1:B1)
# Left N characters
=LEFT(A1, 5)
# Right N characters
=RIGHT(A1, 3)
# Middle substring
=MID(A1, 3, 5) # Start at position 3, length 5
=UPPER(A1) # Convert to uppercase
=LOWER(A1) # Convert to lowercase
=PROPER(A1) # Capitalize first letter of each word
=TRIM(A1) # Remove extra spaces
=CLEAN(A1) # Remove non-printable characters
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])

Example:

=VLOOKUP(A2, D:E, 2, FALSE)
  • Searches for A2 in column D
  • Returns value from column E (2nd column)
  • FALSE = exact match
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found])

Example:

=XLOOKUP(A2, D:D, E:E, "Not Found")
=INDEX(return_range, MATCH(lookup_value, lookup_range, 0))

Example:

=INDEX(E:E, MATCH(A2, D:D, 0))
=IF(condition, value_if_true, value_if_false)

Examples:

=IF(A1 > 100, "High", "Low")
=IF(AND(A1 > 50, B1 < 100), "Valid", "Invalid")
=IF(OR(A1 = "Yes", B1 = "Yes"), "Approved", "Denied")
=IF(A1 >= 90, "A", IF(A1 >= 80, "B", IF(A1 >= 70, "C", "F")))
=IFS(A1 >= 90, "A", A1 >= 80, "B", A1 >= 70, "C", TRUE, "F")
=SWITCH(expression, value1, result1, value2, result2, default)

Example:

=SWITCH(A1, "Red", 1, "Blue", 2, "Green", 3, 0)
=AND(A1 > 10, B1 < 20)
=OR(A1 = "Yes", B1 = "Yes")
=NOT(A1 = "No")
=IF(ISBLANK(A1), "Empty", A1)
=IFERROR(A1/B1, "Error")
=TODAY() # Current date
=NOW() # Current date and time
=DATE(2024, 12, 31) # Create date
=YEAR(A1) # Extract year
=MONTH(A1) # Extract month
=DAY(A1) # Extract day
=EOMONTH(A1, 0) # Last day of month
=WORKDAY(A1, 5) # 5 workdays from A1
=NETWORKDAYS(A1, B1) # Workdays between dates
=DATEDIF(A1, B1, "D") # Days
=DATEDIF(A1, B1, "M") # Months
=DATEDIF(A1, B1, "Y") # Years
=SUM(A1:A10)
=AVERAGE(A1:A10)
=MIN(A1:A10)
=MAX(A1:A10)
=COUNT(A1:A10) # Count numbers
=COUNTA(A1:A10) # Count non-empty cells
=SUMIF(range, criteria, [sum_range])
=COUNTIF(range, criteria)
=AVERAGEIF(range, criteria, [average_range])

Examples:

=SUMIF(A:A, ">100", B:B)
=COUNTIF(A:A, "Yes")
=AVERAGEIF(A:A, "<>0")
=SUMIFS(sum_range, criteria_range1, criteria1, criteria_range2, criteria2)
=COUNTIFS(criteria_range1, criteria1, criteria_range2, criteria2)

Example:

=SUMIFS(C:C, A:A, "Product A", B:B, ">100")
=ROUND(A1, 2) # Round to 2 decimal places
=ROUNDUP(A1, 0) # Round up to integer
=ROUNDDOWN(A1, 0) # Round down to integer
=CEILING(A1, 5) # Round up to nearest 5
=FLOOR(A1, 5) # Round down to nearest 5
=MEDIAN(A1:A10)
=MODE.SNGL(A1:A10) # Most common value
=STDEV.S(A1:A10) # Standard deviation (sample)
=STDEV.P(A1:A10) # Standard deviation (population)
=VAR.S(A1:A10) # Variance (sample)
=PERCENTILE.INC(A1:A10, 0.95) # 95th percentile
=QUARTILE.INC(A1:A10, 1) # First quartile
=FILTER(array, include, [if_empty])

Example:

=FILTER(A2:C100, B2:B100 > 100, "No results")
=SORT(array, [sort_index], [sort_order], [by_col])

Example:

=SORT(A2:C100, 2, -1) # Sort by 2nd column, descending
=UNIQUE(array, [by_col], [exactly_once])

Example:

=UNIQUE(A2:A100)
=UNIQUE(A1:A100)
=SUBSTITUTE(text, old_text, new_text, [instance_num])

Example:

=SUBSTITUTE(A1, "old", "new")
=SUBSTITUTE(A1, " ", "", ) # Remove all spaces
=TEXTSPLIT(text, col_delimiter, [row_delimiter])

Example:

=TEXTSPLIT(A1, ",") # Split by comma

Legacy method:

=LEFT(A1, FIND(",", A1) - 1) # Before comma
=MID(A1, FIND(",", A1) + 1, 999) # After comma
=OFFSET($A$1, 0, 0, COUNTA($A:$A), 1)
=SUM(A1:A10 * B1:B10) # Element-wise multiplication
=IFERROR(VLOOKUP(A1, D:E, 2, FALSE), "Not Found")
=SUMPRODUCT((A1:A10 > 100) * (B1:B10 < 50) * C1:C10)
=INDEX(A:A, MATCH(SMALL(B:B, ROW()), B:B, 0))
A1 # Relative (both row and column change)
$A$1 # Absolute (neither changes)
$A1 # Mixed (column fixed, row changes)
A$1 # Mixed (row fixed, column changes)

Instead of:

=SUM(Sheet1!$A$1:$A$100)

Define name “SalesData” for A1:A100, then use:

=SUM(SalesData)
=IFERROR(formula, value_if_error)
=IFNA(formula, value_if_na)
  • Excel 365: Formulas automatically spill
  • Older Excel: Press Ctrl+Shift+Enter
=SUM($A$2:A2) # Copy down for cumulative sum
=RANK(A2, $A$2:$A$100, 0) # 0 = descending
=SUMPRODUCT(MID(0&A1, LARGE(INDEX(ISNUMBER(--MID(A1, ROW($1:$99), 1)) * ROW($1:$99), 0), ROW($1:$99)) + 1, 1) * 10^ROW($1:$99)/10)

Simpler with REGEX (if available):

=REGEXEXTRACT(A1, "\d+")