Excel formula library
Excel Tutorial
Every Excel formula in one place — search, filter by category or level, then open syntax, samples, and pitfalls. New formulas added to the library appear here automatically.
Formula list
Find any Excel formula
Filter by category — Math, Lookup, FILTER and other Dynamic Arrays, Text, Date, and more — then open a formula for syntax and examples.
- Math & Arithmetic 12
- Statistical Analysis 15
- Logical & Conditional 6
- Lookup & Reference 13
- Date & Time 17
- Text & Strings 25
- Information & Arrays 12
- Dynamic Arrays (365) 6
- Enhanced Lookup (365) 2
- Advanced Calculation (365) 6
- Text & Reshaping (365) 13
No formulas match that search or filter.
Chapter 6
Text & Strings
-
64 CONCAT =CONCAT(text1, [text2], ...) Combines text from multiple ranges and/or strings. Replaces CONCATENATE and allows passing entire multi-cell ranges directly.
Syntax
=CONCAT(text1, [text2], ...)Arguments
- text1
- Text item, range of cells, or string to join.
Sample
=CONCAT(A2, " ", B2)Result Rohan Sharma
Sample data
DownloadA B C D 2 Rohan Sharma HR Rohan Sharma 3 Kabir Verma IT Kabir Verma 4 Meena Gupta Sales Meena Gupta Pro tipUnlike CONCATENATE, CONCAT accepts full ranges like =CONCAT(A2:D2).
Common pitfallCONCAT does not provide a delimiter option between cells; use TEXTJOIN if you need commas or spaces between items.
-
65 CONCATENATE =CONCATENATE(text1, [text2], ...) Classic function to join two or more text strings into one. Still supported for backwards compatibility across legacy workbooks.
Syntax
=CONCATENATE(text1, [text2], ...)Arguments
- text1, text2
- Up to 255 text items to be joined.
Sample
=CONCATENATE(A2, " ", B2)Result Rohan Sharma
Sample data
DownloadA B C D 2 Rohan Sharma Rohan Sharma =A2 & " " & B2 3 Kabir Verma Kabir Verma =A3 & " " & B3 4 Meena Gupta Meena Gupta =A4 & " " & B4 Pro tipYou can achieve the same result faster using the ampersand & operator: =A2 & " " & B2.
Common pitfallDoes NOT accept array ranges like A1:A5 (returns only the first cell or #VALUE!).
-
66 TEXTJOIN =TEXTJOIN(delimiter, ignore_empty, text1, [text2], ...) Combines text from multiple ranges and/or strings, using a specified delimiter, and optionally ignoring empty cells.
Syntax
=TEXTJOIN(delimiter, ignore_empty, text1, [text2], ...)Arguments
- delimiter
- Text string (like comma, space, or hyphen) inserted between each text item.
- ignore_empty
- If TRUE, empty cells are skipped; if FALSE, delimiter is still inserted.
- text1, [text2, ...]
- The strings or multi-cell ranges to join.
Sample
=TEXTJOIN(", ", TRUE, A2:D2)Result Rohan Sharma, HR, 350, Delhi
Sample data
DownloadA B C D 2 Rohan Sharma HR 350 Delhi 3 Kabir Verma IT 400 Mumbai 4 Meena Gupta Sales 450 Pune Pro tipJoin an entire vertical column into a single cell in one shot: =TEXTJOIN(", ", TRUE, A2:A50).
Common pitfallIf the resulting text exceeds 32,767 characters (Excel single-cell limit), TEXTJOIN returns #VALUE!.
-
67 LEFT =LEFT(text, [num_chars]) Returns the first character or characters in a text string, based on the number of characters you specify.
Syntax
=LEFT(text, [num_chars])Arguments
- text
- The text string that contains the characters you want to extract.
- [num_chars]
- Specifies the number of characters you want LEFT to extract. Default is 1.
Sample
=LEFT(A2, 5)Result Rohan
Sample data
DownloadA B C D 2 Rohan Sharma E-101 Rohan First 5 letters 3 Kabir Verma E-102 Kabir First 5 letters 4 Meena Gupta E-103 Meena First 5 letters Pro tipExtract first name dynamically regardless of length: =LEFT(A2, FIND(" ", A2) - 1).
Common pitfallNum_chars must be greater than or equal to 0; negative numbers return #VALUE!.
-
68 RIGHT =RIGHT(text, [num_chars]) Returns the last character or characters in a text string, based on the number of characters you specify.
Syntax
=RIGHT(text, [num_chars])Arguments
- text
- The text string containing characters to extract.
- [num_chars]
- The number of characters to extract from the right. Default is 1.
Sample
=RIGHT(A2, 4)Result 4321
Sample data
DownloadA B C D 2 XXXX-XXXX-XXXX-4321 Rohan Sharma 4321 Ending digits 3 XXXX-XXXX-XXXX-8765 Kabir Verma 8765 Ending digits 4 XXXX-XXXX-XXXX-1122 Meena Gupta 1122 Ending digits Pro tipTo extract dynamic last name: =RIGHT(A2, LEN(A2) - FIND(" ", A2)).
Common pitfallNumbers returned by RIGHT are formatted as text strings. Wrap in VALUE() if you need to calculate with them.
-
69 MID =MID(text, start_num, num_chars) Returns a specific number of characters from a text string, starting at the position you specify, based on the number of characters you specify.
Syntax
=MID(text, start_num, num_chars)Arguments
- text
- The text string containing the characters you want to extract.
- start_num
- The position of the first character you want to extract (1-based).
- num_chars
- The number of characters to return from the start position.
Sample
=MID(A2, 7, 6)Result Sharma
Sample data
DownloadA B C D 2 Rohan Sharma EMP-01 Sharma Chars from pos 7 3 Kabir Verma EMP-02 Verma Chars from pos 7 4 Meena Gupta EMP-03 Gupta Chars from pos 7 Pro tipIf num_chars exceeds the remaining length of the string, MID simply returns all remaining characters without error.
Common pitfallStart_num must be >= 1. If start_num is greater than string length, MID returns empty string "".
-
70 LEN =LEN(text) Returns the number of characters in a text string. Counts letters, numbers, punctuation, spaces, and invisible characters.
Syntax
=LEN(text)Arguments
- text
- The text whose length you want to measure.
Sample
=LEN(A2)Result 12
Sample data
DownloadA B C D 2 Rohan Sharma 12 11 letters + 1 space Valid ( Pro tipCount occurrences of a specific letter (e.g. "a") in cell A1: =LEN(A1) - LEN(SUBSTITUTE(LOWER(A1), "a", "")).
Common pitfallSpaces count toward LEN! Trailing spaces often cause passwords or lookup matches to fail unexpectedly.
-
71 TRIM =TRIM(text) Removes all spaces from text except for single spaces between words. Perfect for cleaning messy data exports.
Syntax
=TRIM(text)Arguments
- text
- The text from which you want spaces removed.
Sample
=TRIM(A2)Result Rohan Sharma
Sample data
DownloadA B C D 2 Rohan Sharma 18 Rohan Sharma 12 (Extra 6 removed) 3 Kabir Verma 13 Kabir Verma 11 (Cleaned) 4 Meena Gupta 14 Meena Gupta 11 (Cleaned) Pro tipTRIM only removes standard ASCII space 32. For stubborn non-breaking web spaces (ASCII 160), use =TRIM(CLEAN(SUBSTITUTE(A1, CHAR(160), " "))).
Common pitfallTRIM preserves single spaces between words; it only removes extra duplicates and leading/trailing ones.
-
72 UPPER =UPPER(text) Converts text to uppercase. Useful for standardizing code keys, state abbreviations, and passport numbers.
Syntax
=UPPER(text)Arguments
- text
- The text you want converted to uppercase.
Sample
=UPPER(A2)Result ROHAN SHARMA
Sample data
DownloadA B C D 2 Rohan Sharma ROHAN SHARMA EMP-RS Formatted 3 kabir verma KABIR VERMA EMP-KV Formatted 4 Meena GUPTA MEENA GUPTA EMP-MG Formatted Pro tipNumbers and punctuation marks in the text are completely unaffected by UPPER.
Common pitfallCannot modify text in-place directly; you must output to a helper column, then copy and paste-as-values.
-
73 LOWER =LOWER(text) Converts all letters in a text string to lowercase. Essential for normalizing customer emails and web domains.
Syntax
=LOWER(text)Arguments
- text
- The text you want converted to lowercase.
Sample
=LOWER(A2)Result rohan.sharma@corp.com
Sample data
DownloadA B C D 2 Rohan.SHARMA@Corp.com rohan.sharma@corp.com Yes Active 3 KABIR.VERMA@CORP.COM kabir.verma@corp.com Yes Active 4 Meena.Gupta@CORP.COM meena.gupta@corp.com Yes Active Pro tipEssential preliminary step before running EXACT comparisons if you want case-insensitivity.
Common pitfallDoes not strip spaces; combine with TRIM if needed: =LOWER(TRIM(A2)).
-
74 PROPER =PROPER(text) Capitalizes the first letter in a text string and any other letters in text that follow any character other than a letter. Converts all other letters to lowercase.
Syntax
=PROPER(text)Arguments
- text
- Text enclosed in quotation marks, a formula that returns text, or a cell reference.
Sample
=PROPER(A2)Result Rohan Sharma
Sample data
DownloadA B C D 2 rohan sharma Rohan Sharma delhi ? Delhi Standard Title 3 KABIR VERMA Kabir Verma mumbai ? Mumbai Standard Title 4 mEeNa GuPtA Meena Gupta pune ? Pune Standard Title Pro tipPROPER treats any letter after a non-letter (like an apostrophe or hyphen) as a new word (e.g. "o'connor" becomes "O'Connor").
Common pitfallAcronyms like "USA" or "NASA" will be converted to "Usa" and "Nasa" by PROPER.
-
75 REPLACE =REPLACE(old_text, start_num, num_chars, new_text) Replaces part of a text string, based on the number of characters and position you specify, with a new text string.
Syntax
=REPLACE(old_text, start_num, num_chars, new_text)Arguments
- old_text
- Text in which you want to replace some characters.
- start_num
- The position of the character in old_text that you want to replace.
- num_chars
- The number of characters in old_text that you want REPLACE to replace.
- new_text
- The text that will replace characters in old_text.
Sample
=REPLACE(A2, 1, 3, "USR")Result USR-101
Sample data
DownloadA B C D 2 EMP-101 HR USR-101 Replaced "EMP" with "USR" 3 EMP-102 IT USR-102 Replaced "EMP" with "USR" 4 EMP-103 Sales USR-103 Replaced "EMP" with "USR" Pro tipSet num_chars to 0 to INSERT text at a specific position without deleting existing characters!
Common pitfallREPLACE is strictly position-based; if you want to replace specific text regardless of where it appears, use SUBSTITUTE.
-
76 SUBSTITUTE =SUBSTITUTE(text, old_text, new_text, [instance_num]) Substitutes new_text for old_text in a text string. Use when you want to replace specific text rather than a fixed position.
Syntax
=SUBSTITUTE(text, old_text, new_text, [instance_num])Arguments
- text
- The text or the reference to a cell containing text for which you want to substitute characters.
- old_text
- The text you want to replace.
- new_text
- The replacement string.
- [instance_num]
- Specifies which occurrence of old_text you want to replace. If omitted, every occurrence is replaced.
Sample
=SUBSTITUTE(A2, "Sharma", "Kumar")Result Rohan Kumar
Sample data
DownloadA B C D 2 Rohan Sharma Sharma ? Kumar Rohan Kumar Replaced text 3 Amit Sharma Sharma ? Kumar Amit Kumar Replaced text 4 Kabir Verma Verma ? Singh Kabir Singh Replaced text Pro tipSUBSTITUTE is case-sensitive ("sharma" will not match "Sharma").
Common pitfallIf old_text does not match the exact letter case, SUBSTITUTE silently returns the original text unchanged.
-
77 TEXT =TEXT(value, format_text) Converts a numeric or date value to formatted text according to a specified format string.
Syntax
=TEXT(value, format_text)Arguments
- value
- A numeric value, a formula that evaluates to a numeric value, or a cell reference.
- format_text
- A custom format code enclosed in quotes (e.g. "dd-mmm-yyyy", "$#,##0.00", "0.0%").
Sample
=TEXT(A2, "dd-mmm-yyyy")Result 45757
Sample data
DownloadA B C D 2 45757 10-Apr-2025 Thursday (=TEXT(A2,"dddd")) Q2-2025 3 45658 01-Jan-2025 Wednesday Q1-2025 4 45884 15-Aug-2025 Friday Q3-2025 Pro tipUse format "dddd" for full weekday name ("Thursday") or "mmmm" for full month name ("April").
Common pitfallThe result is TEXT, not a number or date! You cannot perform mathematical sums directly on the output of TEXT.
-
78 VALUE =VALUE(text) Converts a text string that represents a number to a number. Enables math on text-formatted imported data.
Syntax
=VALUE(text)Arguments
- text
- The text enclosed in quotation marks or a reference to a cell containing text to convert.
Sample
=VALUE(A2)Result 1000
Sample data
DownloadA B C D 2 "1000" String Text 1,000 Yes (Ready for SUM) 3 "$450.50" String Text 450.50 Yes 4 " 85 " String Text 85 Yes Pro tipA fast shortcut to convert text to number is adding zero: =A2 + 0 or double unary --A2.
Common pitfallIf text contains non-numeric characters that cannot be parsed into a number, VALUE returns #VALUE!.
-
79 NUMBERVALUE =NUMBERVALUE(text, [decimal_separator], [group_separator]) Converts text to a number in a locale-independent way. Crucial when working with European comma decimals.
Syntax
=NUMBERVALUE(text, [decimal_separator], [group_separator])Arguments
- text
- The text to convert to a number.
- [decimal_separator]
- The character used to separate the integer and fraction of the result.
- [group_separator]
- The character used to separate thousands groupings.
Sample
=NUMBERVALUE("1.250,50", ",", ".")Result 1250.5
Sample data
DownloadA B C D 2 "1.250,50" Comma (,) 1250.50 1,250.50 3 "450,75" Comma (,) 450.75 450.75 4 "10 000,00" Space ( ) 10000.00 10,000.00 Pro tipNUMBERVALUE automatically handles trailing percentage signs like "15%".
Common pitfallDecimal separator and group separator must be different characters; using the same character returns #VALUE!.
-
80 DOLLAR =DOLLAR(number, [decimals]) Converts a number to text using currency format, with decimals rounded to the specified place.
Syntax
=DOLLAR(number, [decimals])Arguments
- number
- A number, a reference to a cell containing a number, or a formula that evaluates to a number.
- [decimals]
- The number of digits to the right of the decimal point. Default is 2.
Sample
=DOLLAR(B2, 2)Result $1,250.00
Sample data
DownloadA B C D 2 Server License 1250 $1,250.00 Currency Text 3 Cloud Storage 45.8 $45.80 Currency Text 4 Domain Name 12.99 $12.99 Currency Text Common pitfallThe return value is a text string. You cannot use SUM or AVERAGE on the output of DOLLAR().
-
81 FIND =FIND(find_text, within_text, [start_num]) Locates one text string within a second text string, and returns the number of the starting position. FIND is case-sensitive and does not support wildcards.
Syntax
=FIND(find_text, within_text, [start_num])Arguments
- find_text
- The text you want to find.
- within_text
- The text containing the text you want to find.
- [start_num]
- Specifies character at which to start search (default is 1).
Sample
=FIND("Sharma", A2)Result 7
Sample data
DownloadA B C D 2 Rohan Sharma 7 Exact Case Match Found at char 7 3 Kabir Verma #VALUE! Not Found Sharma not present 4 Amit Sharma 6 Exact Case Match Found at char 6 Pro tipIf you want case-insensitive search, use SEARCH instead of FIND.
Common pitfallIf find_text is not found, FIND returns a #VALUE! error. Wrap in IFERROR to handle gracefully.
-
82 SEARCH =SEARCH(find_text, within_text, [start_num]) Locates one text string within a second text string, and returns the number of the starting position. Case-insensitive and supports * and ? wildcards.
Syntax
=SEARCH(find_text, within_text, [start_num])Arguments
- find_text
- The text you want to find (wildcards allowed).
- within_text
- The text in which you want to search.
Sample
=SEARCH("sharma", A2)Result 7
Sample data
DownloadA B C D 2 Rohan Sharma 7 Found uppercase S Position 7 3 Rohan sharma 7 Found lowercase s Position 7 4 ROHAN SHARMA 7 Found all-caps Position 7 Pro tipTest if a cell contains a word: =ISNUMBER(SEARCH("apple", A2)).
Common pitfallIf you need exact case matching, use FIND instead of SEARCH.
-
83 EXACT =EXACT(text1, text2) Compares two text strings and returns TRUE if they are exactly identical, including case sensitivity, and FALSE otherwise.
Syntax
=EXACT(text1, text2)Arguments
- text1, text2
- The two text strings you want to compare.
Sample
=EXACT(A2, B2)Result FALSE
Sample data
DownloadA B C D 2 Sharma SHARMA FALSE (Case mismatch) TRUE (Case insensitive) 3 Sharma Sharma TRUE (Exact match) TRUE 4 Verma Verma FALSE (Trailing space) FALSE Pro tipStandard Excel = comparison is case-insensitive ("a" = "A" is TRUE). Use EXACT when case matters.
Common pitfallEXACT checks spaces too; an invisible trailing space will cause EXACT to return FALSE.
-
84 CLEAN =CLEAN(text) Removes all nonprintable characters from text (ASCII 0 through 31). Strips unwanted line breaks and system control characters.
Syntax
=CLEAN(text)Arguments
- text
- Any worksheet information from which you want to remove nonprintable characters.
Sample
=CLEAN(A2)Result Cleaned String
Sample data
DownloadA B C D 2 Line 1 Line 2 Line 1 Line 2 ASCII 10 (Linefeed) Sanitized 3 Raw Tabbed Data RawTabbedData ASCII 9 (Tab) Sanitized 4 System Feed System Feed ASCII 13 (CR) Sanitized Pro tipOften combined with TRIM for total data sanitation: =TRIM(CLEAN(A2)).
Common pitfallCLEAN only removes ASCII 0-31. It does NOT remove non-breaking web spaces (ASCII 160).
-
85 CHAR =CHAR(number) Returns the character specified by a number. Use CHAR to translate code page numbers into characters (e.g. CHAR(10) for line break).
Syntax
=CHAR(number)Arguments
- number
- A number between 1 and 255 specifying the character you want.
Sample
=CHAR(A2)Result A
Sample data
DownloadA B C D 2 65 A Capital letter A Letter generation 3 66 B Capital letter B Letter generation 4 10 LineBreak Line Feed (Wrap text) Multi-line formulas Pro tipTo make CHAR(10) show as a line break, enable "Wrap Text" on the cell formatting.
Common pitfallNumbers outside the 1 to 255 range return a #VALUE! error.
-
86 UNICHAR =UNICHAR(number) Returns the Unicode character that is referenced by the given numeric value, including modern symbols, tick marks, and emojis.
Syntax
=UNICHAR(number)Arguments
- number
- The Unicode number that represents the character.
Sample
=UNICHAR(A2)Result ?
Sample data
DownloadA B C D 2 10004 ? Green Checkmark Target Met 3 10008 ? Cross Mark Target Missed 4 9733 ? Solid Star Rating Scale Pro tipUse UNICHAR(9650) for green up-arrow ? and UNICHAR(9660) for red down-arrow ? in financial dashboards.
Common pitfallIf number is 0 or outside Unicode range, UNICHAR returns #VALUE!.
-
87 UNICODE =UNICODE(text) Returns the number (code point) corresponding to the first character of the text.
Syntax
=UNICODE(text)Arguments
- text
- The character or string for which you want the Unicode value.
Sample
=UNICODE(A2)Result 65
Sample data
DownloadA B C D 2 A 65 U+0041 Basic Latin 3 ? 10004 U+2714 Dingbats Symbol 4 ? 9733 U+2605 Star Symbol Pro tipUNICODE only evaluates the first character of the input string.
Common pitfallEmpty text "" returns #VALUE!.
-
88 REPT =REPT(text, number_times) Repeats text a given number of times. Classic technique for building lightweight in-cell bar charts and star ratings.
Syntax
=REPT(text, number_times)Arguments
- text
- The text you want to repeat.
- number_times
- A positive number specifying the number of times to repeat text.
Sample
=REPT("?", B2)Result ?????
Sample data
DownloadA B C D 2 Laptop Pro 5 ????? Top Rated 3 Wireless Mouse 4 ???? High Rating 4 USB-C Hub 3 ??? Average Pro tipFormat the in-cell chart formula =REPT("|", A2) with the font "Playbill" or "Stencil" to create solid bar charts!
Common pitfallIf number_times is 0, REPT returns empty text "". If negative, returns #VALUE!.
