
PROVIDING ACCURATE, RELIABLE AND STRAIGHT TO THE POINT KNOWLEDGE ABOUT DIFFERENT IT TOOLS EXPLAINED WITH PRACTICAL EXAMPLES
CONTENTS
EXCEL FUNCTION-SEARCH
INTRODUCTION
SEARCH FUNCTION is one of the very important and useful functions in Excel.
As SEARCH FUNCTION is concerned with the text, it is present under the TEXT FUNCTION CATEGORY of the functions.
SEARCH FUNCTION FINDS THE POSITION OF A CHARACTER OR ANY TEXT FRAGMENT INSIDE ANOTHER TEXT AND RETURNS THE STARTING CHARACTER LOCATION AS THE POSITION.
SEARCH FUNCTION counts the characters whether it is single byte or double byte. [Byte is the size of the characters]
SEARCH FUNCTION is quite useful in manipulating text to get the desired results easily.
In this article we would learn about the purpose, syntax, formula of the SEARCH FUNCTION and get a better understanding with the help of the examples.
PURPOSE OF SEARCH FUNCTION IN EXCEL
SEARCH FUNCTION is used to search any character or text fragment within a longer text and return its starting number.
For example,
Suppose we need to find out the location of any character or text pattern in the given text.
let us take a text snippet ” Have a wonderful day!“
Now if we want to find the location of the first ‘a’ or the word ‘wonderful’ we can do so with the use of SEARCH FUNCTION.
The requirements can be of numerous types such as finding out any character or word before we replace it or extract it.
PREREQUISITES TO LEARN SEARCH FUNCTION
THERE ARE A FEW PREREQUISITES WHICH WILL ENABLE YOU TO UNDERSTAND THIS FUNCTION IN A BETTER WAY.
- Basic understanding of how to use a formula or function.
- Basic understanding of rows and columns in Excel.
- Some information about the TEXT HANDLING IN EXCEL is an advantage for the use of such formulas.
- Of course, Excel software.
SYNTAX: SEARCH FUNCTION
The Syntax for the SEARCH function is
SEARCH FUNCTION IS NOT CASE SENSITIVE. IT’LL MATCH ONLY THE CONTENT AND NOT THE CASE.
EXAMPLES:SEARCH FUNCTION IN EXCEL
EXAMPLE TYPE 1: SEARCHING A LETTER [FIRST OCCURRENCE]
Let us take a group of words say “GOOD MORNING”.
Let us try to find out the position of ‘G’, space, ‘I’ and o.
STEPS TO FIND OUT THE POSITION OF THE CHARACTER IN THE GIVEN WORDS:
- Select the cell where we want the result.
- Enter the following formulas for G , space and I in the given word.
- For finding the G, put the formula as =SEARCH(“G”,E6,1)
- For finding the ” ” SPACE, put the formula as =SEARCH(” “,E7,1)
- For finding the I, put the formula as =SEARCH(“I”,E8,1)
- For finding the o, put the formula as =SEARCH(“o”,E8,1) . The answer was still returned as it ignored the case.
EXAMPLE TYPE 2: SEARCHING A TEXT PATTERN IN THE GIVEN TEXT
Let us take a sentence ” Humpty Dumpty sat on a wall”
Let us try to find out the pattern ‘pty’ in the given sentence.
STEPS TO FIND OUT THE POSITION OF THE TEXT PATTERN IN THE GIVEN SENTENCE:
- Select the cell where we want the result.
- Enter the following formulas for finding “pty”.
- For finding the text pattern “pty”, put the formula as =FIND(“pty”,E20,1)
- Click Enter.
- The result would appear.
- The picture below shows the result and other details.
EXPLANATION:
Let us understand the working of the formula.
We used the formula =FIND(“pty”,E20,1)
Where the first argument “pty” is the one which we want to find.
E20 contains the complete sentence in which we want to find the occurrence position of this pattern
Third argument is 1 which tells us that we want to start the search from the position 1.
Now, we might be thinking about the situation where there are two occurrences of “pty” in the sentence. What if we need the location of second occurrence.
Well, there is no direct function for finding out the second occurrence but we can use a trick to find one.
The next example is the extension to this one and finds out the second occurrence of “pty”
EXAMPLE TYPE 3: SEARCHING the TEXT pattern at the second position
Let us take a sentence ” Humpty Dumpty sat on a wall”
Let us try to find out the second occurrence of the pattern ‘pty’ in the given sentence.
STEPS TO FIND OUT THE POSITION OF THE SECOND OCCURRENCE OF THE PATTERN IN THE GIVEN SENTENCE:
- Select the cell where we want the result.
- Enter the following formulas for finding the second occurrence of the pattern “pty”.
- For finding the second occurrence of “pty” , put the formula as =FIND(“pty”,E29,FIND(“pty”,E29,1)+1)
- Click Enter.
- The result would appear.
- The picture below shows the result and other details.
EXPLANATION:
Let us understand the working of the formula.
We used the formula =FIND(“pty”,E29,FIND(“pty”,E29,1)+1)
KNOWLEDGE BYTES
difference between FIND FUNCTION AND SEARCH FUNCTION
OTHER WAYS TO REACH THIS ARTICLE
WHAT IS EXCEL, HOW EXCEL WORKS, WRITE FORMULA IN EXCEL, EXAMPLE OF USING FORMULA IN EXCEL, ANIMATED EXAMLPE OF USING FORMULA IN EXCEL
YOU MAY LIKE
- HOW TO TROUBLESHOOT A FORMULA IN EXCEL?
- USE OF FONTS, FONT SIZE, INDENTATION, TEXT TO THE RIGHT, TEXT TO THE LEFT, TEXT IN THE MIDDLE ETC.
- how to insert table in excel?
- FOR MORE ARTICLES, CLICK EXCEL OR TYPE IN SEARCH BELOW.