Dapatkan posisi satu string teks di dalam string teks lainnya
=FIND(find_text, within_text, [start_num])
| Parameter | Deskripsi |
|---|---|
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. |
The basic syntax of the FIND function looks like this
FIND(find_text,within_text,[start_num])
The FIND function is designed to look inside a text string for a specific substring. When FIND locates the substring, it returns the position of the s
=FIND("p","apple") // returns 2
=FIND("z","apple") // returns #VALUE!
=FIND("apple","Pineapple") // returns 5
Note that text values entered directly into FIND must be enclosed in double quotes (""). As mentioned above, the FIND function is always case-sensitiv
=FIND("a","Apple") // returns #VALUE!
=FIND("A","Apple") // returns 1
=FIND("Apple","Pineapple") // returns #VALUE!
By default, the FIND function returns a number when a search string is found and a #VALUE! error when not. This is inconvenient in cases where you sim
=ISNUMBER(FIND("p","apple")) // returns TRUE
=ISNUMBER(FIND("z","apple")) // returns FALSE
Once you have a TRUE or FALSE result, you can combine the FIND function with the IF function to create "if cell contains" logic. The generic pattern f
=IF(ISNUMBER(FIND(substring,A1)), "Yes", "No")
The formula in C5, copied down, is:
=IF(ISNUMBER(FIND("abc",B5)),"x","")