inspector
text
Find It. Control It.
You're In Charge.
itFINDR
Same as Excel's built-in FIND function, but searches from right to left.
Locates one text string within a second text string, and returns the number of the ending (rightmost) position of the first text string from the last character of the second text string.
Like Excel's built-in FIND function, itFINDR:
itFINDR is intended to be as similar as possible to Excel's built-in FIND function, while searching from right to left. For much more powerful and versatile searching, see itSEARCH.
Syntax
itFINDR(find_text,within_text,start_num)
| find_text | Required. The text to look for in within_text. |
| within_text | Required. The text in which to look for find_text. |
| start_num | The character at which to
start the search, starting from the right. The rightmost character in
within_text is 1. If start_num is omitted, the search begins at the rightmost character in within_text. |
Examples
| Formula | Description | Result | ||||
| =itFINDR("b","abcde") | Find "b" in "abcde", and return the position counting from the right. | 4 | ||||
| =itFINDR("bc","abcde") | Find "bc" in "abcde", and return the position of the last (rightmost) character in "bc", counting from the right. | 3 | ||||
| =itFINDR("ab","abcabc",3) | Find "ab" in "abcabc", looking from the right starting with the 3rd character in "abcabc" from the right, and return the last (rightmost) character in "ab", counting from the right. | 5 (The search starts with the 2nd "a" ("abcabc", because it is the 3rd character from the right. Looking to the left from there, the next "ab" found is the first one ("abcabc"). Counting from the right, those two characters are in positions 5 and 6, and the rightmost character of them ("b"), is in position 5.) |
||||
| =itFINDR("a","abcABC") | Find "a" (case sensitive) in "abcABC" and return the position counting from the right. | 6 (The "A" in "abcABC" is ignored because itgFINDR is case sensitive. See itSEARCH or itSEARCHR for non-case sensitive searches.) |
||||
=RIGHT(A1,itFINDR("\",A1)-1)
|
Return the filename in the path in cell A1, no matter how many levels of folders are in the path. | MyFile.xls (itFINDR finds the position of the last backslash, which is 11. Excel's built-in RIGHT function subtracts 1 from that and gets the resulting number of characters (10 characters) from the right-hand side of the text. Those 10 characters are the filename in the path.) |