Find value excel function

Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2019 for Mac Excel 2016 Excel 2016 for Mac Excel 2013 Excel 2010 Excel 2007 Excel for Mac 2011 Excel Starter 2010 More…Less

This article describes the formula syntax and usage of the FIND and FINDB functions in Microsoft Excel.

Description

FIND and FINDB locate one text string within a second text string, and return the number of the starting position of the first text string from the first character of the second text string.

Important: 

  • These functions may not be available in all languages.

  • FIND is intended for use with languages that use the single-byte character set (SBCS), whereas FINDB is intended for use with languages that use the double-byte character set (DBCS). The default language setting on your computer affects the return value in the following way:

  • FIND always counts each character, whether single-byte or double-byte, as 1, no matter what the default language setting is.

  • FINDB counts each double-byte character as 2 when you have enabled the editing of a language that supports DBCS and then set it as the default language. Otherwise, FINDB counts each character as 1.

The languages that support DBCS include Japanese, Chinese (Simplified), Chinese (Traditional), and Korean.

Syntax

FIND(find_text, within_text, [start_num])

FINDB(find_text, within_text, [start_num])

The FIND and FINDB function syntax has the following arguments:

  • Find_text    Required. The text you want to find.

  • Within_text    Required. The text containing the text you want to find.

  • Start_num    Optional. Specifies the character at which to start the search. The first character in within_text is character number 1. If you omit start_num, it is assumed to be 1.

Remarks

  • FIND and FINDB are case sensitive and don’t allow wildcard characters. If you don’t want to do a case sensitive search or use wildcard characters, you can use SEARCH and SEARCHB.

  • If find_text is «» (empty text), FIND matches the first character in the search string (that is, the character numbered start_num or 1).

  • Find_text cannot contain any wildcard characters.

  • If find_text does not appear in within_text, FIND and FINDB return the #VALUE! error value.

  • If start_num is not greater than zero, FIND and FINDB return the #VALUE! error value.

  • If start_num is greater than the length of within_text, FIND and FINDB return the #VALUE! error value.

  • Use start_num to skip a specified number of characters. Using FIND as an example, suppose you are working with the text string «AYF0093.YoungMensApparel». To find the number of the first «Y» in the descriptive part of the text string, set start_num equal to 8 so that the serial-number portion of the text is not searched. FIND begins with character 8, finds find_text at the next character, and returns the number 9. FIND always returns the number of characters from the start of within_text, counting the characters you skip if start_num is greater than 1.

Examples

Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.

Data

Miriam McGovern

Formula

Description

Result

=FIND(«M»,A2)

Position of the first «M» in cell A2

1

=FIND(«m»,A2)

Position of the first «M» in cell A2

6

=FIND(«M»,A2,3)

Position of the first «M» in cell A2, starting with the third character

8

Example 2

Data

Ceramic Insulators #124-TD45-87

Copper Coils #12-671-6772

Variable Resistors #116010

Formula

Description (Result)

Result

=MID(A2,1,FIND(» #»,A2,1)-1)

Extracts text from position 1 to the position of «#» in cell A2 (Ceramic Insulators)

Ceramic Insulators

=MID(A3,1,FIND(» #»,A3,1)-1)

Extracts text from position 1 to the position of «#» in cell A3 (Copper Coils)

Copper Coils

=MID(A4,1,FIND(» #»,A4,1)-1)

Extracts text from position 1 to the position of «#» in cell A4 (Variable Resistors)

Variable Resistors

Need more help?

Функция НАЙТИ (FIND) в Excel используется для поиска текстового значения внутри строчки с текстом и указать порядковый номер буквы с которого начинается искомое слово в найденной строке.

Содержание

  1. Что возвращает функция
  2. Синтаксис
  3. Аргументы функции
  4. Дополнительная информация
  5. Примеры использования функции НАЙТИ в Excel
  6. Пример 1. Ищем слово в текстовой строке (с начала строки)
  7. Пример 2. Ищем слово в текстовой строке (с заданным порядковым номером старта поиска)
  8. Пример 3. Поиск текстового значения внутри текстовой строки с дублированным искомым значением

Что возвращает функция

Возвращает числовое значение, обозначающее стартовую позицию текстовой строчки внутри другой текстовой строчки.

Синтаксис

=FIND(find_text, within_text, [start_num]) — английская версия

=НАЙТИ(искомый_текст;просматриваемый_текст;[нач_позиция]) — русская версия

Аргументы функции

  • find_text (искомый_текст) — текст или строка которую вы хотите найти в рамках другой строки;
  • within_text (просматриваемый_текст) — текст, внутри которого вы хотите найти аргумент find_text (искомый_текст);
  • [start_num] ([нач_позиция]) — число, отображающее позицию, с которой вы хотите начать поиск. Если аргумент не указать, то поиск начнется сначала.

Дополнительная информация

  • Если стартовое число не указано, то функция начинает поиск искомого текста с начала строки;
  • Функция НАЙТИ чувствительна к регистру. Если вы хотите сделать поиск без учета регистра, используйте функцию SEARCH в Excel;
  • Функция не учитывает подстановочные знаки при поиске. Если вы хотите использовать подстановочные знаки для поиска, используйте функцию SEARCH в Excel;
  • Функция каждый раз возвращает ошибку, когда не находит искомый текст в заданной строке.

Примеры использования функции НАЙТИ в Excel

Пример 1. Ищем слово в текстовой строке (с начала строки)

Функция НАЙТИ в Excel

На примере выше мы ищем слово «Доброе» в словосочетании «Доброе Утро». По результатам поиска, функция выдает число «1», которое обозначает, что слово «Доброе» начинается с первой по очереди буквы в, заданной в качестве области поиска, текстовой строке.

Telegram Logo Больше лайфхаков в нашем Telegram Подписаться

Обратите внимание, что так как функция НАЙТИ в Excel чувствительна к регистру, вы не сможете найти слово «доброе» в словосочетании «Доброе утро», так как оно написано с маленькой буквы. Для того, чтобы осуществить поиска без учета регистра следует пользоваться функцией SEARCH.

Пример 2. Ищем слово в текстовой строке (с заданным порядковым номером старта поиска)

Функция НАЙТИ в Excel

Третий аргумент функции НАЙТИ указывает позицию, с которой функция начинает поиск искомого значения. На примере выше функция возвращает число «1» когда мы начинаем поиск слова «Доброе» в словосочетании «Доброе утро» с начала текстовой строки. Но если мы зададим аргумент функции start_num (нач_позиция) со значением «2», то функция выдаст ошибку, так как начиная поиск со второй буквы текстовой строки, она не может ничего найти.

Если вы не укажете номер позиции, с которой функции следует начинать поиск искомого аргумента, то Excel по умолчанию начнет поиск с самого начала текстовой строки.

Пример 3. Поиск текстового значения внутри текстовой строки с дублированным искомым значением

Функция НАЙТИ в Excel

На примере выше мы ищем слово «Доброе» в словосочетании «Доброе Доброе утро». Когда мы начинаем поиск слова «Доброе» с начала текстовой строки, то функция выдает число «1», так как первое слово «Доброе» начинается с первой буквы в словосочетании «Доброе Доброе утро».

Но, если мы укажем в качестве аргумента start_num (нач_позиция) число «2» и попросим функцию начать поиск со второй буквы в заданной текстовой строке, то функция выдаст число «6», так как Excel находит искомое слово «Доброе» начиная со второй буквы словосочетания «Доброе Доброе утро» только на 6 позиции.

Purpose 

Get location substring in a string

Return value 

A number representing the location of substring

Usage notes 

The FIND function returns the position (as a number) of one text string inside another. If there is more than one occurrence of the search string, FIND returns the position of the first occurrence. When the text is not found, FIND returns a #VALUE error. Also note, when find_text is empty, FIND returns 1. FIND does not support wildcards, and is always case-sensitive. Use the SEARCH function to find the position of text without case-sensitivity and with wildcard support. 

Basic Example

The FIND function is designed to look inside a text string for a specific substring. When FIND locates the substring, it returns a position of the substring in the text as a number. If the substring is not found, FIND returns a #VALUE error. For example:

=FIND("p","apple") // returns 2
=FIND("z","apple") // returns #VALUE!

Note that text values entered directly into FIND must be enclosed in double-quotes («»).

Case-sensitive

The FIND function always case-sensitive:

=FIND("a","Apple") // returns #VALUE!
=FIND("A","Apple") // returns 1

TRUE or FALSE result

To force a TRUE or FALSE result, nest the FIND function inside the ISNUMBER function. ISNUMBER returns TRUE for numeric values and FALSE for anything else. If FIND locates the substring, it returns the position as a number, and ISNUMBER returns TRUE:

=ISNUMBER(FIND("p","apple")) // returns TRUE
=ISNUMBER(FIND("z","apple")) // returns FALSE

If FIND doesn’t locate the substring, it returns an error, and ISNUMBER returns FALSE. 

Start number

The FIND function has an optional argument called start_num, that controls where FIND should begin looking for a substring. To find the first match of «the» in any combination of upper or lowercase, you can omit start_num, which defaults to 1:

=FIND("x","20 x 30 x 50") // returns 4

To start searching at character 5, enter 4 for start_num:

=FIND("x","20 x 30 x 50",5) // returns 9

Wildcards

The FIND function does not support wildcards. See the SEARCH function.

If cell contains

To return a custom result with the SEARCH function, use the IF function like this:

=IF(ISNUMBER(FIND(substring,A1)), "Yes", "No")

Instead of returning TRUE or FALSE, the formula above will return «Yes» if substring is found and «No» if not.

Notes

  • The FIND function returns the location of the first find_text in within_text.
  • The location is returned as the number of characters from the start.
  • Start_num is optional and defaults to 1.
  • FIND returns 1 when find_text is empty.
  • FIND returns #VALUE if find_text is not found.
  • FIND is case-sensitive but does not support wildcards.
  • Use the SEARCH function to find a substring with wildcards.

totn Excel Functions


This Excel tutorial explains how to use the Excel FIND function with syntax and examples.

Description

The Microsoft Excel FIND function returns the location of a substring in a string. The search is case-sensitive.

The FIND function is a built-in function in Excel that is categorized as a String/Text Function. It can be used as a worksheet function (WS) in Excel. As a worksheet function, the FIND function can be entered as part of a formula in a cell of a worksheet.

subscribe button Subscribe


If you want to follow along with this tutorial, download the example spreadsheet.

Download Example

Syntax

The syntax for the FIND function in Microsoft Excel is:

FIND( substring, string, [start_position] )

Parameters or Arguments

substring
The substring that you want to find.
string
The string to search within.
start_position
Optional. It is the position in string where the search will start. The first position is 1. If the start_position is not provided, the FIND function will start the search at the beginning of the string.

Returns

The FIND function returns a numeric value. The first position in the string is 1.
If the FIND function does not find a match, it will return a #VALUE! error.

Applies To

  • Excel for Office 365, Excel 2019, Excel 2016, Excel 2013, Excel 2011 for Mac, Excel 2010, Excel 2007, Excel 2003, Excel XP, Excel 2000

Type of Function

  • Worksheet function (WS)

Example (as Worksheet Function)

Let’s look at some Excel FIND function examples and explore how to use the FIND function as a worksheet function in Microsoft Excel:

Microsoft Excel

Based on the Excel spreadsheet above, the following FIND examples would return:

=FIND(B2,A2)
Result: 1

=FIND("T",A2)
Result: 1

=FIND("t",A3)
Result: 12

=FIND("The",A4)
Result: 7

=FIND("Z",A5)
Result: #VALUE!

=FIND("T", A2, 3)
Result: 7

Frequently Asked Questions

Question: In Microsoft Excel, I have the value «Supermarket» in cell A1 and 100 in cell A2.

Objective: If A1 contains «Super», then I want A3=A2. Otherwise, I want A3=0. I’m unable to use the FIND function because if cell A1 does not contain «Super», the FIND function returns the #VALUE! error which does not let me sum column A.

Answer: To make sure that do not return any #VALUE! errors when using the FIND function, you need to also use the ISERROR function in your formula.

Let’s look at an example.

Microsoft Excel

Based on the Excel spreadsheet above, the following FIND examples would return:

=IF(ISERROR(FIND("Super",A1,1))=TRUE,0,A2)
Result: 100

In this case, cell A1 does contain the value «Super», so the formula returns the value found in cell A2 which is 100.

Microsoft Excel

Based on the Excel spreadsheet above, the following FIND examples would return:

=IF(ISERROR(FIND("Super",A1,1))=TRUE,0,A2)
Result: 0

In this example, cell A1 does NOT contain the value «Super», so the formula returns 0.

Let’s just quickly explain how this formula works. If cell A1 contains «Super», the FIND function will return the numerical position of the value of «Super». Thus, an error will not result (ie. the IsError function evaluates to FALSE) and the formula will return A2.

If cell A1 does NOT contain «Super», the FIND function will return the #VALUE! error causing the IsError function to evaluate to TRUE and return 0.

The FIND function is a built-in Worksheet Function (WS) in Microsoft Excel, which you can use to locate a sub-string or a specific character’s position within a text string. It is categorized as a TEXT function in Excel.

If the FIND function fails to find the text, it will return a #VALUE error. Note that the Excel FIND function will perform a case-sensitive search.

Excel FIND function is commonly used by financial analysts for locating specific data or text occurrences in a cell.

Excel-FIND-Function

Syntax of Excel FIND function

=FIND(find_text, within_text, [start_num])

Arguments:

'find_text' – The text/sub-string you want to locate.
'within_text' – This argument is the string within which you wish to perform the search. You can supply a cell reference or type in the string into the formula.
'start_num' – This is an optional argument wherein you specify the character from which your search must begin. If you omit this argument, the function will assume this parameter as 1, i.e., the search will begin from the 1st character of the 'within_text' string.

Things to Remember

  • The FIND function in Excel is case-sensitive and does not allow the usage of wildcard characters. For locating case-insensitive matches, take a look at the SEARCH function.
  • The FIND function will search the 'find_text' argument in 'within_text' and return the first character’s position.
  • You may search for either a substring or a character with the 'find_text'argument. You may use cell references or text characters for both 'find_text' and 'within_text' The FIND function will return ‘1’ when the 'find_text' argument is an empty string «».
  • The FIND function returns #VALUE! error when:
    • The FIND function cannot locate 'find_text'in 'within_text' or
    • The 'start_num' argument is negative, 0, or greater than the length of 'within_text'

Examples of FIND function in Excel

Example 1 – Finding a word’s position in a text string

Find Function Example 1

In this example, when you search for «Dallas» and reference the cell A2, which has the text string «Dallas, USA» the function will return ‘1’. Here, 1 represents the position of the searched word’s starting point.

On account of the FIND function’s case-sensitivity, entering «dallas» as an argument will return #VALUE! error.

Example 2 – Search for a word in a text string

Find Function Example 2

The 'start_num' argument lets you decide the starting position for performing the search in the text string. You will see that in the above example, the FIND function returns ‘1’ when we put 1 as the 'start_num'. Essentially, it searches for the text «Dallas» in «Dallas, USA».

When we change 'start_num' to ‘2’, it returns an error because it then searches for «Dallas» in «allas, USA».

Note that skipping the 'start_num' argument will result in the FIND function assuming ‘1’ as the starting position.

Example 3 – When the searched text occurs multiple times in a text string

Find Function Example 3

Since the FIND function refers to the 'start_num' argument to see if you would like to define a starting position, it returns ‘1’ when you input 'start_num' as 1. This is because it finds «Dallas» at position ‘1’ in «Dallas, Dallas, USA».

When you input 'start_num' as 2, though, you will see that it returns ‘9’. What is happening here is that the FIND function tries to look for the word «Dallas» in «allas, Dallas, USA» since you are asking the function to start searching from the second position. Here, 9 is the starting position of the 2nd «Dallas» in «Dallas, Dallas, USA».

Example 4 – Look for a specific character’s Nth occurrence in a string.

Find Function Example 4

Let’s now assume that you would like to know the position of the second «,» in the list that has the format «City, Country, Continent».

For this, we will need to nest two FIND functions one within another. The second FIND function will go in the first FIND function as a third argument ('start_num'), like so:

=FIND(",",A2,FIND(",",A2)+1)

With the third argument, you are instructing the first FIND function to start searching for «,» exactly after the first occurrence of a «,» in the string.

Pro tip: You can use the CHAR and SUBSTITUTE functions to do this more simply, with the following formula:

=FIND(CHAR(1), SUBSTITUTE(A5,",",CHAR(1),2)

Example 5 – Retrieving the first part of a text string separated by «,» (comma)

Find Function Example 5

Let’s assume you want the list of just the name of cities, without the name of the country, i.e., the characters right before «,»).

To accomplish this, we will use the LEFT function and the FIND function together. The FIND function will give us the position of «,» and the LEFT function will allow us to retrieve the name of the cities.

In our example, the FIND function will return 10 when executed on «Amsterdam, Netherlands». From this, we will subtract 1 since we don’t want to include the «,» in our output.

Next, we embed a FIND function into the LEFT function and use FIND(",", A2,1)-1 as the second argument, like so:

=LEFT(A2,FIND(",",A2,1)-1)

Example 6 – Retrieving the second part of a text string separated by «,» (comma)

Find Function Example 6

Let’s take example 5, and try to retrieve the second part of the string.

To accomplish this, we will use the MID function and the FIND function together. The FIND function will give us the position of «,» and the MID function will allow us to fetch the specific string portion that we need.

In our example, the FIND function will return 10 when executed on «Amsterdam, Netherlands». From this, we will add 1 since we don’t want to include the «,» in our output.

Next, we use a MID function and pass the FIND function to it FIND(",", A2,1)+1 as the second argument, like so:

=MID(A2,FIND(",",A2,1)+1,100)

FIND function vs. SEARCH function in Excel

Both Find and Search functions have a similar syntax and application. However, there are 2 differences between these functions. Let’s dive into what these differences are:

1. Acceptance of wildcard characters

Unlike with the FIND function, you may use wildcard characters in the SEARCH function’s 'find_text' argument.

To match one character – we will use a question mark ‘?’, and to match a series of characters – we will use an asterisk mark ‘*’.

Let’s work this out with an example:

Search Function With Wildcards 7

We will use the syntax:

=SEARCH(",*EUROPE",A2)

Notice how the Excel SEARCH function returns the first character’s position if you input both «,» and the «continent name» regardless of how many characters exist between the text string referred to in the 'within_text'argument.

Pro tip: For finding a ‘?’ or ‘*’, just add a tilde (~) in front of the question mark or the asterisk.

2. FIND is case-sensitive, while SEARCH is case-insensitive

As I mentioned previously, case-sensitivity is another differentiating factor between the two functions.

Find Function VS Search Function 8

In our example, when using the FIND function to search for ‘A’ it returns the position of the capital A in ‘USA’. However, searching for ‘A’ with the SEARCH function returns the position of the ‘a’ in ‘Dallas’ because it is case-insensitive.

Handling #VALUE! errors in the FIND function

To deal with #VALUE! errors, we can use the IFERROR function.

Let’s revisit our first example where we first encountered a #VALUE! error with FIND function on account of the FIND function’s case-sensitivity.

Find Function Error Handling

Here is the syntax we will use to fix this:

=IFERROR(FIND("dallas",A3,1), "Not Found!")

Using this syntax, we will «trap» the error and replace it with a standard string in the second argument of the IFERROR function, which in our case is «Not Found!». So, until the FIND function is able to return a matched string, the function will keep returning «Not Found».

Понравилась статья? Поделить с друзьями:
  • Find use in a sentence for each word
  • Find unique in excel
  • Find underlined text in word
  • Find twelve culture words in the word search 18
  • Find translation of the following words and word combinations in the text