Find in excel returns value

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.

Содержание

  1. FIND, FINDB functions
  2. Description
  3. Syntax
  4. Remarks
  5. Examples
  6. In Excel find and return next value that meets the criteria
  7. FIND Function
  8. Related functions
  9. Summary
  10. Purpose
  11. Return value
  12. Arguments
  13. Syntax
  14. Usage notes
  15. Basic Example
  16. Case-sensitive
  17. TRUE or FALSE result
  18. Start number
  19. Wildcards
  20. If cell contains
  21. How to Return Cell Address Instead of Value in Excel (Easy Formula)
  22. Lookup And Return Cell Address Using the ADDRESS Function
  23. Lookup And Return Cell Address Using the CELL Function
  24. Excel — Find a value in an array and return the contents of the corresponding column
  25. 4 Answers 4

FIND, FINDB functions

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.

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.

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.

Источник

In Excel find and return next value that meets the criteria

Have a seemingly simple question that I just don’t know how to fix. These are the excel columns:

# is the comment sign. bewtween ** ** is highlight

The key is to find a value in ‘number’ column with current value being 1 and next one being 0 (call it end point), and then look for next value in same column with current value being 1 and previous one being 0 (call start point). Between each start point and end point is a short line.

Then in ‘result’ column (can go to any row), calculate a result of function based on existing values (just name it functionA ) and when the calculated result resultA reaches a threshold value 3, I will highlight all the values involved in these two lines and remove them later on. As seen in the data. resultA is calculated using the value of points (ID2 and ID5) in ‘number ’ column, and it reaches the threshold , so all points in these two lines are highlighted in bold font. resultB doesn’t reach the threshold, so points in line3 are not highlighted. I cannot think of how to write function that fill in the column ‘result’ . Any idea?

Now the question has simplified: the H column is my result ! And what i need to do is just find the H cell that is small than 100 (the cell highlighted is 48 so it meets criteria), and highlight all data that have consecutive 1 values in K column as 1,1,1. and closest to the current row. as being highlighted in the image. This selection is the final step.

H column in worksheet corresponds to result column in the first excel dataset. Now just look at the worksheet.

this row 13 (with H value of 48.9) is where a end point is in—from K column you can see a series of 1.. and that tells you where is end and starting point of each list made of 1.

so 48.09 on H13 is calculated using the G13 and G15, which are the G column value of end point of current list and starting point of next list. so K13=function(G13,G15)

what needs to do is, if this value in H Follow

Источник

FIND Function

Summary

The Excel FIND function returns the position (as a number) of one text string inside another. When the text is not found, FIND returns a #VALUE error.

Purpose

Return value

Arguments

  • find_text — The substring to find.
  • within_text — The text to search within.
  • start_num — [optional] The starting position in the text to search. Optional, defaults to 1.

Syntax

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:

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

Case-sensitive

The FIND function always case-sensitive:

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:

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:

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

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:

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

Источник

How to Return Cell Address Instead of Value in Excel (Easy Formula)

When using lookup formulas in Excel (such as VLOOKUP, XLOOKUP, or INDEX/MATCH), the intent is to find the matching value and get that value (or a corresponding value in the same row/column) as the result.

But in some cases, instead of getting the value, you may want the formula to return the cell address of the value.

This could be especially useful if you have a large data set and you want to find out the exact position of the lookup formula result.

There are some functions in Excel that designed to do exactly this.

In this tutorial, I will show you how you can find and return the cell address instead of the value in Excel using simple formulas.

This Tutorial Covers:

Lookup And Return Cell Address Using the ADDRESS Function

The ADDRESS function in Excel is meant to exactly this.

It takes the row and the column number and gives you the cell address of that specific cell.

Below is the syntax of the ADDRESS function:

  • row_num: Row number of the cell for which you want the cell address
  • column_num: Column number of the cell for which you want the address
  • [abs_num]: Optional argument where you can specify whether want the cell reference to be absolute, relative, or mixed.
  • [a1]: Optional argument where you can specify whether you want the reference in the R1C1 style or A1 style
  • [sheet_text]: Optional argument where you can specify whether you want to add the sheet name along with the cell address or not

Now, let’s take an example and see how this works.

Suppose there is a dataset as shown below, where I have the Employee id, their name, and their department, and I want to quickly know the cell address that contains the department for employee id KR256.

Below is the formula that will do this:

In the above formula, I have used the MATCH function to find out the row number that contains the given employee id.

And since the department is in column C, I have used 3 as the second argument.

This formula works great, but it has one drawback – it won’t work if you add the row above the dataset or a column to the left of the dataset.

This is because when I specify the second argument (the column number) as 3, it’s hard-coded and won’t change.

In case I add any column to the left of the dataset, the formula would count 3 columns from the beginning of the worksheet and not from the beginning of the dataset.

So, if you have a fixed dataset and need a simple formula, this will work fine.

But if you need this to be more fool-proof, use the one covered in the next section.

Lookup And Return Cell Address Using the CELL Function

While the ADDRESS function was made specifically to give you the cell reference of the specified row and column number, there is another function that also does this.

It’s called the CELL function (and it can give you a lot more information about the cell than the ADDRESS function).

Below is the syntax of the CELL function:

  • info_type: the information about the cell you want. This could be the address, the column number, the file name, etc.
  • [reference]: Optional argument where you can specify the cell reference for which you need the cell information.

Now, let’s see an example where you can use this function to look up and get the cell reference.

Suppose you have a dataset as shown below, and you want to quickly know the cell address that contains the department for employee id KR256.

Below is the formula that will do this:

The above formula is quite straightforward.

I have used the INDEX formula as the second argument to get the department for the employee id KR256.

And then simply wrapped it within the CELL function and asked it to return the cell address of this value that I get from the INDEX formula.

Now here is the secret to why it works – the INDEX formula returns the lookup value when you give it all the necessary arguments. But at the same time, it would also return the cell reference of that resulting cell.

In our example, the INDEX formula returns “Sales” as the resulting value, but at the same time, you can also use it to give you the cell reference of that value instead of the value itself.

Normally, when you enter the INDEX formula in a cell, it returns the value because that is what it’s expected to do. But in scenarios where a cell reference is required, the INDEX formula will give you the cell reference.

In this example, that’s exactly what it does.

And the best part about using this formula is that it is not tied to the first cell in the worksheet. This means that you can select any data set (which could be anywhere in the worksheet), use the INDEX formula to do a regular look up and it would still give you the correct address.

And if you insert an additional row or column, the formula would adjust accordingly to give you the correct cell address.

So these are two simple formulas that you can use to look up and find and return the cell address instead of the value in Excel.

I hope you found this tutorial useful.

Other Excel tutorials you may also like:

Источник

Excel — Find a value in an array and return the contents of the corresponding column

I am trying to find a value within an array and then return the value in a specific row in the corresponding column.

In the example below, I need to know which bay the Chevrolet is in:

I am looking for Chevrolet in the array C2:E5. Once it determines that the Chevrolet is in Column D, I need for it to return the value in D1. If it was in column E, I need it to return the value in E1.

Any help would be greatly appreciated. Thank you so much in advance.

4 Answers 4

Try this Array Formula:

or if you are sure that each column contains exactly what’s being searched it can be written like this:

Enter formula in any cell by pressing Ctrl + Shitf + Enter .

How does it work?
Our ultimate goal is to find the Column that contains the match:

  • First we did the search for the match using this formula: SEARCH(A1,$C$1:$E$5) . It just checks if any of the entries matched A1. Actually, it can be simplified to $C$1:$E$5=A1 but I’m not sure if all entries in each column match exactly what’s in A1.
  • That formula will produce an array of values when entered as array formula. Something like: . The result will be array of number(s) and error (if non was found). But we don’t want that, else we will be returning error everytime.
  • We then use IF(NOT(ISERROR(SEARCH(A1,$C$1:$E$5))),COLUMN($A:$C),99^99) . This formula returns the Column Number if there is a match and a relatively huge number 99^99 otherwise. Result would be: <99^99, 99^99, 99^99, 2, . 99^99>.
  • And we are close to what we need since we already have an array of Column and huge number. We just use SMALL to return the smallest number which in my opinion is the lowest Column Number where a match is found. So SMALL(IF(NOT(ISERROR(SEARCH(A1,$C$1:$E$5))),COLUMN($A:$C),99^99),1) would return 2. Which is the column where Chevrolet is referenced at $C$1:$E$1.
  • Since we already have the column number we simply use INDEX Function which is: INDEX($C$1:$E$5,1,2) .

Note: 99^99 can be any relatively large number. Not necessarily 99^99 . Actual 16385(max column number in Excel 2007 and up + 1) can be used.

Result:

Источник

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.

Like this post? Please share to your friends:
  • Find in each line the odd word out перевод
  • Find in the text english equivalents for these words and word combinations and use
  • Find in each line the odd word out loving cruel caring
  • Find in the text english equivalents for these word combinations and sentences
  • Find in all sheets in excel