Multiple Search Formula in Excel [duplicate]
This question is an exact duplicate of:
Excel multiple FIND formula
1 answer
I am trying to find a formula which will search one cell for specific words.
I would like the outcome of the formula to be words I have selected.
The example of this I have is if one cell shows the list of ingredients, and the other cell shows a list of allergens. I need the formula to search the list of ingredients and choose the allergens.
I know that I could use the find function so that it came back with one result and then concatenate the results but there must be a more simple way!
Thanks
microsoft-excel worksheet-function search find concatenation
marked as duplicate by Rajesh S, fixer1234, PeterH, LotPings, music2myear Jan 4 at 21:59
This question was marked as an exact duplicate of an existing question.
|
show 1 more comment
This question is an exact duplicate of:
Excel multiple FIND formula
1 answer
I am trying to find a formula which will search one cell for specific words.
I would like the outcome of the formula to be words I have selected.
The example of this I have is if one cell shows the list of ingredients, and the other cell shows a list of allergens. I need the formula to search the list of ingredients and choose the allergens.
I know that I could use the find function so that it came back with one result and then concatenate the results but there must be a more simple way!
Thanks
microsoft-excel worksheet-function search find concatenation
marked as duplicate by Rajesh S, fixer1234, PeterH, LotPings, music2myear Jan 4 at 21:59
This question was marked as an exact duplicate of an existing question.
nope I doubt there is a more simple way, use CONCATENATE MID & FIND, it should be fairly simple to achieve
– PeterH
Dec 21 '18 at 12:42
Can you explain how you would do it please?
– Imi
Dec 21 '18 at 12:51
Yeah sure, edit your question to show exactly what is in Cell C3, and what exactly you want to see in C6, and I will show you how I would go about doing it
– PeterH
Dec 21 '18 at 12:53
don't use image, just type it out please
– PeterH
Dec 21 '18 at 12:53
In Cell C3: Oats, rice syrup,cacao nibs, cashew nuts, pea protein crisps, sunflower seeds, coconut oil, cacao powder, matcha green tea, sea salt, almond oil
– Imi
Dec 21 '18 at 12:55
|
show 1 more comment
This question is an exact duplicate of:
Excel multiple FIND formula
1 answer
I am trying to find a formula which will search one cell for specific words.
I would like the outcome of the formula to be words I have selected.
The example of this I have is if one cell shows the list of ingredients, and the other cell shows a list of allergens. I need the formula to search the list of ingredients and choose the allergens.
I know that I could use the find function so that it came back with one result and then concatenate the results but there must be a more simple way!
Thanks
microsoft-excel worksheet-function search find concatenation
This question is an exact duplicate of:
Excel multiple FIND formula
1 answer
I am trying to find a formula which will search one cell for specific words.
I would like the outcome of the formula to be words I have selected.
The example of this I have is if one cell shows the list of ingredients, and the other cell shows a list of allergens. I need the formula to search the list of ingredients and choose the allergens.
I know that I could use the find function so that it came back with one result and then concatenate the results but there must be a more simple way!
Thanks
This question is an exact duplicate of:
Excel multiple FIND formula
1 answer
microsoft-excel worksheet-function search find concatenation
microsoft-excel worksheet-function search find concatenation
edited Dec 21 '18 at 12:54
PeterH
3,49832447
3,49832447
asked Dec 21 '18 at 12:39
ImiImi
93
93
marked as duplicate by Rajesh S, fixer1234, PeterH, LotPings, music2myear Jan 4 at 21:59
This question was marked as an exact duplicate of an existing question.
marked as duplicate by Rajesh S, fixer1234, PeterH, LotPings, music2myear Jan 4 at 21:59
This question was marked as an exact duplicate of an existing question.
nope I doubt there is a more simple way, use CONCATENATE MID & FIND, it should be fairly simple to achieve
– PeterH
Dec 21 '18 at 12:42
Can you explain how you would do it please?
– Imi
Dec 21 '18 at 12:51
Yeah sure, edit your question to show exactly what is in Cell C3, and what exactly you want to see in C6, and I will show you how I would go about doing it
– PeterH
Dec 21 '18 at 12:53
don't use image, just type it out please
– PeterH
Dec 21 '18 at 12:53
In Cell C3: Oats, rice syrup,cacao nibs, cashew nuts, pea protein crisps, sunflower seeds, coconut oil, cacao powder, matcha green tea, sea salt, almond oil
– Imi
Dec 21 '18 at 12:55
|
show 1 more comment
nope I doubt there is a more simple way, use CONCATENATE MID & FIND, it should be fairly simple to achieve
– PeterH
Dec 21 '18 at 12:42
Can you explain how you would do it please?
– Imi
Dec 21 '18 at 12:51
Yeah sure, edit your question to show exactly what is in Cell C3, and what exactly you want to see in C6, and I will show you how I would go about doing it
– PeterH
Dec 21 '18 at 12:53
don't use image, just type it out please
– PeterH
Dec 21 '18 at 12:53
In Cell C3: Oats, rice syrup,cacao nibs, cashew nuts, pea protein crisps, sunflower seeds, coconut oil, cacao powder, matcha green tea, sea salt, almond oil
– Imi
Dec 21 '18 at 12:55
nope I doubt there is a more simple way, use CONCATENATE MID & FIND, it should be fairly simple to achieve
– PeterH
Dec 21 '18 at 12:42
nope I doubt there is a more simple way, use CONCATENATE MID & FIND, it should be fairly simple to achieve
– PeterH
Dec 21 '18 at 12:42
Can you explain how you would do it please?
– Imi
Dec 21 '18 at 12:51
Can you explain how you would do it please?
– Imi
Dec 21 '18 at 12:51
Yeah sure, edit your question to show exactly what is in Cell C3, and what exactly you want to see in C6, and I will show you how I would go about doing it
– PeterH
Dec 21 '18 at 12:53
Yeah sure, edit your question to show exactly what is in Cell C3, and what exactly you want to see in C6, and I will show you how I would go about doing it
– PeterH
Dec 21 '18 at 12:53
don't use image, just type it out please
– PeterH
Dec 21 '18 at 12:53
don't use image, just type it out please
– PeterH
Dec 21 '18 at 12:53
In Cell C3: Oats, rice syrup,cacao nibs, cashew nuts, pea protein crisps, sunflower seeds, coconut oil, cacao powder, matcha green tea, sea salt, almond oil
– Imi
Dec 21 '18 at 12:55
In Cell C3: Oats, rice syrup,cacao nibs, cashew nuts, pea protein crisps, sunflower seeds, coconut oil, cacao powder, matcha green tea, sea salt, almond oil
– Imi
Dec 21 '18 at 12:55
|
show 1 more comment
2 Answers
2
active
oldest
votes
If you have Office 365 Excel which introduced TEXTJOIN, You can use it in an array formula:
=TEXTJOIN(", ",,IF(ISNUMBER(FIND( {"GLUTEN","PEANUTS"},C3)),{"GLUTEN","PEANUTS"},""))
Being an Array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode.
This will iterate the two names and test the string with Find. If found then Find returnd a number if not an error. We find where it returns a number and then the second array will return the correct value to the TEXT JOIN
But a better practice would be to create a table with the allergens listed:
Then you can refer to that list in the TEXTJOIN formula instead of maintaining it in the formula itself:
=TEXTJOIN(", ",,IF(ISNUMBER(SEARCH( ALLERGEN[ALLERGENS],C3)),ALLERGEN[ALLERGENS],""))
Still an array formula, and I switched to SEARCH to deal with the difference of capitalization.
Now, as new allergens are needed the they can be added to the list without the need to update the formula.
I have office for Mac 2016, will this change what to input?
– Imi
Dec 21 '18 at 16:06
@Imi then you probably do not have TEXTJOIN. It available only with Office 365 Excel and later.
– Scott Craner
Dec 21 '18 at 16:07
do you have an alternative answer for excel 2016?
– Imi
Dec 21 '18 at 16:24
No, you will need to do what @peterH answered. There is no quick formula fix in your edition.
– Scott Craner
Dec 21 '18 at 16:29
’ve been playing with this formula because I couldn’t get the original syntax to work and it’s nearly doing what I would like. Please can you help me make it case insensitive? Here is the data and my current formula:
– Imi
Dec 23 '18 at 20:01
|
show 1 more comment
In Cell C6 you can use the below formula,
=MID(C3,FIND("Gluten",C3),LEN("Gluten"))&", "&MID(C3,FIND("Peanuts",C3),LEN("Peanuts"))
you can add more allergens to serch for by adding the below onto the end of the formula:
&", "&MID(C3,FIND("Another Allergen",C3),LEN("Another Allergen"))
And repeat as needed.
You can also error proof this for when you list an allergen which may not be in the ingredients:
=IFERROR(MID(C3,FIND("Gluten",C3),LEN("Gluten")),"")&", "&IFERROR(MID(C3,FIND("Peanuts",C3),LEN("Peanuts")),"")&", "&IFERROR(MID(C3,FIND("Another Allergen",C3),LEN("Another Allergen")),"")
Because this uses FIND the search pattern is case sensitive, you may want to consider swapping there for the SEARCH function which still takes the same 2 arguments in the same order.
It has come back with 'Not enough arguments were entered for this function.'
– Imi
Dec 21 '18 at 13:06
will the error proof work if the ingredients is in the list of allergens?
– Imi
Dec 21 '18 at 13:07
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you have Office 365 Excel which introduced TEXTJOIN, You can use it in an array formula:
=TEXTJOIN(", ",,IF(ISNUMBER(FIND( {"GLUTEN","PEANUTS"},C3)),{"GLUTEN","PEANUTS"},""))
Being an Array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode.
This will iterate the two names and test the string with Find. If found then Find returnd a number if not an error. We find where it returns a number and then the second array will return the correct value to the TEXT JOIN
But a better practice would be to create a table with the allergens listed:
Then you can refer to that list in the TEXTJOIN formula instead of maintaining it in the formula itself:
=TEXTJOIN(", ",,IF(ISNUMBER(SEARCH( ALLERGEN[ALLERGENS],C3)),ALLERGEN[ALLERGENS],""))
Still an array formula, and I switched to SEARCH to deal with the difference of capitalization.
Now, as new allergens are needed the they can be added to the list without the need to update the formula.
I have office for Mac 2016, will this change what to input?
– Imi
Dec 21 '18 at 16:06
@Imi then you probably do not have TEXTJOIN. It available only with Office 365 Excel and later.
– Scott Craner
Dec 21 '18 at 16:07
do you have an alternative answer for excel 2016?
– Imi
Dec 21 '18 at 16:24
No, you will need to do what @peterH answered. There is no quick formula fix in your edition.
– Scott Craner
Dec 21 '18 at 16:29
’ve been playing with this formula because I couldn’t get the original syntax to work and it’s nearly doing what I would like. Please can you help me make it case insensitive? Here is the data and my current formula:
– Imi
Dec 23 '18 at 20:01
|
show 1 more comment
If you have Office 365 Excel which introduced TEXTJOIN, You can use it in an array formula:
=TEXTJOIN(", ",,IF(ISNUMBER(FIND( {"GLUTEN","PEANUTS"},C3)),{"GLUTEN","PEANUTS"},""))
Being an Array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode.
This will iterate the two names and test the string with Find. If found then Find returnd a number if not an error. We find where it returns a number and then the second array will return the correct value to the TEXT JOIN
But a better practice would be to create a table with the allergens listed:
Then you can refer to that list in the TEXTJOIN formula instead of maintaining it in the formula itself:
=TEXTJOIN(", ",,IF(ISNUMBER(SEARCH( ALLERGEN[ALLERGENS],C3)),ALLERGEN[ALLERGENS],""))
Still an array formula, and I switched to SEARCH to deal with the difference of capitalization.
Now, as new allergens are needed the they can be added to the list without the need to update the formula.
I have office for Mac 2016, will this change what to input?
– Imi
Dec 21 '18 at 16:06
@Imi then you probably do not have TEXTJOIN. It available only with Office 365 Excel and later.
– Scott Craner
Dec 21 '18 at 16:07
do you have an alternative answer for excel 2016?
– Imi
Dec 21 '18 at 16:24
No, you will need to do what @peterH answered. There is no quick formula fix in your edition.
– Scott Craner
Dec 21 '18 at 16:29
’ve been playing with this formula because I couldn’t get the original syntax to work and it’s nearly doing what I would like. Please can you help me make it case insensitive? Here is the data and my current formula:
– Imi
Dec 23 '18 at 20:01
|
show 1 more comment
If you have Office 365 Excel which introduced TEXTJOIN, You can use it in an array formula:
=TEXTJOIN(", ",,IF(ISNUMBER(FIND( {"GLUTEN","PEANUTS"},C3)),{"GLUTEN","PEANUTS"},""))
Being an Array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode.
This will iterate the two names and test the string with Find. If found then Find returnd a number if not an error. We find where it returns a number and then the second array will return the correct value to the TEXT JOIN
But a better practice would be to create a table with the allergens listed:
Then you can refer to that list in the TEXTJOIN formula instead of maintaining it in the formula itself:
=TEXTJOIN(", ",,IF(ISNUMBER(SEARCH( ALLERGEN[ALLERGENS],C3)),ALLERGEN[ALLERGENS],""))
Still an array formula, and I switched to SEARCH to deal with the difference of capitalization.
Now, as new allergens are needed the they can be added to the list without the need to update the formula.
If you have Office 365 Excel which introduced TEXTJOIN, You can use it in an array formula:
=TEXTJOIN(", ",,IF(ISNUMBER(FIND( {"GLUTEN","PEANUTS"},C3)),{"GLUTEN","PEANUTS"},""))
Being an Array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode.
This will iterate the two names and test the string with Find. If found then Find returnd a number if not an error. We find where it returns a number and then the second array will return the correct value to the TEXT JOIN
But a better practice would be to create a table with the allergens listed:
Then you can refer to that list in the TEXTJOIN formula instead of maintaining it in the formula itself:
=TEXTJOIN(", ",,IF(ISNUMBER(SEARCH( ALLERGEN[ALLERGENS],C3)),ALLERGEN[ALLERGENS],""))
Still an array formula, and I switched to SEARCH to deal with the difference of capitalization.
Now, as new allergens are needed the they can be added to the list without the need to update the formula.
edited Dec 21 '18 at 15:20
answered Dec 21 '18 at 15:09
Scott CranerScott Craner
11.4k1815
11.4k1815
I have office for Mac 2016, will this change what to input?
– Imi
Dec 21 '18 at 16:06
@Imi then you probably do not have TEXTJOIN. It available only with Office 365 Excel and later.
– Scott Craner
Dec 21 '18 at 16:07
do you have an alternative answer for excel 2016?
– Imi
Dec 21 '18 at 16:24
No, you will need to do what @peterH answered. There is no quick formula fix in your edition.
– Scott Craner
Dec 21 '18 at 16:29
’ve been playing with this formula because I couldn’t get the original syntax to work and it’s nearly doing what I would like. Please can you help me make it case insensitive? Here is the data and my current formula:
– Imi
Dec 23 '18 at 20:01
|
show 1 more comment
I have office for Mac 2016, will this change what to input?
– Imi
Dec 21 '18 at 16:06
@Imi then you probably do not have TEXTJOIN. It available only with Office 365 Excel and later.
– Scott Craner
Dec 21 '18 at 16:07
do you have an alternative answer for excel 2016?
– Imi
Dec 21 '18 at 16:24
No, you will need to do what @peterH answered. There is no quick formula fix in your edition.
– Scott Craner
Dec 21 '18 at 16:29
’ve been playing with this formula because I couldn’t get the original syntax to work and it’s nearly doing what I would like. Please can you help me make it case insensitive? Here is the data and my current formula:
– Imi
Dec 23 '18 at 20:01
I have office for Mac 2016, will this change what to input?
– Imi
Dec 21 '18 at 16:06
I have office for Mac 2016, will this change what to input?
– Imi
Dec 21 '18 at 16:06
@Imi then you probably do not have TEXTJOIN. It available only with Office 365 Excel and later.
– Scott Craner
Dec 21 '18 at 16:07
@Imi then you probably do not have TEXTJOIN. It available only with Office 365 Excel and later.
– Scott Craner
Dec 21 '18 at 16:07
do you have an alternative answer for excel 2016?
– Imi
Dec 21 '18 at 16:24
do you have an alternative answer for excel 2016?
– Imi
Dec 21 '18 at 16:24
No, you will need to do what @peterH answered. There is no quick formula fix in your edition.
– Scott Craner
Dec 21 '18 at 16:29
No, you will need to do what @peterH answered. There is no quick formula fix in your edition.
– Scott Craner
Dec 21 '18 at 16:29
’ve been playing with this formula because I couldn’t get the original syntax to work and it’s nearly doing what I would like. Please can you help me make it case insensitive? Here is the data and my current formula:
– Imi
Dec 23 '18 at 20:01
’ve been playing with this formula because I couldn’t get the original syntax to work and it’s nearly doing what I would like. Please can you help me make it case insensitive? Here is the data and my current formula:
– Imi
Dec 23 '18 at 20:01
|
show 1 more comment
In Cell C6 you can use the below formula,
=MID(C3,FIND("Gluten",C3),LEN("Gluten"))&", "&MID(C3,FIND("Peanuts",C3),LEN("Peanuts"))
you can add more allergens to serch for by adding the below onto the end of the formula:
&", "&MID(C3,FIND("Another Allergen",C3),LEN("Another Allergen"))
And repeat as needed.
You can also error proof this for when you list an allergen which may not be in the ingredients:
=IFERROR(MID(C3,FIND("Gluten",C3),LEN("Gluten")),"")&", "&IFERROR(MID(C3,FIND("Peanuts",C3),LEN("Peanuts")),"")&", "&IFERROR(MID(C3,FIND("Another Allergen",C3),LEN("Another Allergen")),"")
Because this uses FIND the search pattern is case sensitive, you may want to consider swapping there for the SEARCH function which still takes the same 2 arguments in the same order.
It has come back with 'Not enough arguments were entered for this function.'
– Imi
Dec 21 '18 at 13:06
will the error proof work if the ingredients is in the list of allergens?
– Imi
Dec 21 '18 at 13:07
add a comment |
In Cell C6 you can use the below formula,
=MID(C3,FIND("Gluten",C3),LEN("Gluten"))&", "&MID(C3,FIND("Peanuts",C3),LEN("Peanuts"))
you can add more allergens to serch for by adding the below onto the end of the formula:
&", "&MID(C3,FIND("Another Allergen",C3),LEN("Another Allergen"))
And repeat as needed.
You can also error proof this for when you list an allergen which may not be in the ingredients:
=IFERROR(MID(C3,FIND("Gluten",C3),LEN("Gluten")),"")&", "&IFERROR(MID(C3,FIND("Peanuts",C3),LEN("Peanuts")),"")&", "&IFERROR(MID(C3,FIND("Another Allergen",C3),LEN("Another Allergen")),"")
Because this uses FIND the search pattern is case sensitive, you may want to consider swapping there for the SEARCH function which still takes the same 2 arguments in the same order.
It has come back with 'Not enough arguments were entered for this function.'
– Imi
Dec 21 '18 at 13:06
will the error proof work if the ingredients is in the list of allergens?
– Imi
Dec 21 '18 at 13:07
add a comment |
In Cell C6 you can use the below formula,
=MID(C3,FIND("Gluten",C3),LEN("Gluten"))&", "&MID(C3,FIND("Peanuts",C3),LEN("Peanuts"))
you can add more allergens to serch for by adding the below onto the end of the formula:
&", "&MID(C3,FIND("Another Allergen",C3),LEN("Another Allergen"))
And repeat as needed.
You can also error proof this for when you list an allergen which may not be in the ingredients:
=IFERROR(MID(C3,FIND("Gluten",C3),LEN("Gluten")),"")&", "&IFERROR(MID(C3,FIND("Peanuts",C3),LEN("Peanuts")),"")&", "&IFERROR(MID(C3,FIND("Another Allergen",C3),LEN("Another Allergen")),"")
Because this uses FIND the search pattern is case sensitive, you may want to consider swapping there for the SEARCH function which still takes the same 2 arguments in the same order.
In Cell C6 you can use the below formula,
=MID(C3,FIND("Gluten",C3),LEN("Gluten"))&", "&MID(C3,FIND("Peanuts",C3),LEN("Peanuts"))
you can add more allergens to serch for by adding the below onto the end of the formula:
&", "&MID(C3,FIND("Another Allergen",C3),LEN("Another Allergen"))
And repeat as needed.
You can also error proof this for when you list an allergen which may not be in the ingredients:
=IFERROR(MID(C3,FIND("Gluten",C3),LEN("Gluten")),"")&", "&IFERROR(MID(C3,FIND("Peanuts",C3),LEN("Peanuts")),"")&", "&IFERROR(MID(C3,FIND("Another Allergen",C3),LEN("Another Allergen")),"")
Because this uses FIND the search pattern is case sensitive, you may want to consider swapping there for the SEARCH function which still takes the same 2 arguments in the same order.
edited Dec 21 '18 at 17:23
RickyTillson
1887
1887
answered Dec 21 '18 at 12:57
PeterHPeterH
3,49832447
3,49832447
It has come back with 'Not enough arguments were entered for this function.'
– Imi
Dec 21 '18 at 13:06
will the error proof work if the ingredients is in the list of allergens?
– Imi
Dec 21 '18 at 13:07
add a comment |
It has come back with 'Not enough arguments were entered for this function.'
– Imi
Dec 21 '18 at 13:06
will the error proof work if the ingredients is in the list of allergens?
– Imi
Dec 21 '18 at 13:07
It has come back with 'Not enough arguments were entered for this function.'
– Imi
Dec 21 '18 at 13:06
It has come back with 'Not enough arguments were entered for this function.'
– Imi
Dec 21 '18 at 13:06
will the error proof work if the ingredients is in the list of allergens?
– Imi
Dec 21 '18 at 13:07
will the error proof work if the ingredients is in the list of allergens?
– Imi
Dec 21 '18 at 13:07
add a comment |
nope I doubt there is a more simple way, use CONCATENATE MID & FIND, it should be fairly simple to achieve
– PeterH
Dec 21 '18 at 12:42
Can you explain how you would do it please?
– Imi
Dec 21 '18 at 12:51
Yeah sure, edit your question to show exactly what is in Cell C3, and what exactly you want to see in C6, and I will show you how I would go about doing it
– PeterH
Dec 21 '18 at 12:53
don't use image, just type it out please
– PeterH
Dec 21 '18 at 12:53
In Cell C3: Oats, rice syrup,cacao nibs, cashew nuts, pea protein crisps, sunflower seeds, coconut oil, cacao powder, matcha green tea, sea salt, almond oil
– Imi
Dec 21 '18 at 12:55