Nested formula to search a text string and return specific text
Here's an approach that illustrates how it could be done, although I'm
sure there must be shorter ways (but it's late here!!). Suppose your
text containing the language is in column D, starting with D1, and
assume you have just 4 languages in M1:M4. Put this formula in E1:
=IF(ISNUMBER(SEARCH(M$1,D1)),M$1,"")&IF(ISNUMBER(S EARCH(M$2,D1)),M
$2,"")&IF(ISNUMBER(SEARCH(M$3,D1)),M$3,"")&IF(ISNU MBER(SEARCH(M
$4,D1)),M$4,"")
and copy down. Here it is again but split manually so that you can see
how it is put together:
=IF(ISNUMBER(SEARCH(M$1,D1)),M$1,"")
&IF(ISNUMBER(SEARCH(M$2,D1)),M$2,"")
&IF(ISNUMBER(SEARCH(M$3,D1)),M$3,"")
&IF(ISNUMBER(SEARCH(M$4,D1)),M$4,"")
Notice how each term is very similar to the one before it - the only
change is the (absolute) row for the M cell reference. If you have 24
languages then the formula would be:
=IF(ISNUMBER(SEARCH(M$1,D1)),M$1,"")&IF(ISNUMBER(S EARCH(M$2,D1)),M
$2,"")&IF(ISNUMBER(SEARCH(M$3,D1)),M$3,"")&IF(ISNU MBER(SEARCH(M
$4,D1)),M$4,"")&IF(ISNUMBER(SEARCH(M$5,D1)),M$5,"" )&IF(ISNUMBER(SEARCH
(M$6,D1)),M$6,"")&IF(ISNUMBER(SEARCH(M$7,D1)),M$7, "")&IF(ISNUMBER
(SEARCH(M$8,D1)),M$8,"")&IF(ISNUMBER(SEARCH(M$9,D1 )),M$9,"")&IF
(ISNUMBER(SEARCH(M$10,D1)),M$10,"")&IF(ISNUMBER(SE ARCH(M$11,D1)),M
$11,"")&IF(ISNUMBER(SEARCH(M$12,D1)),M$12,"")&IF(I SNUMBER(SEARCH(M
$13,D1)),M$13,"")&IF(ISNUMBER(SEARCH(M$14,D1)),M$1 4,"")&IF(ISNUMBER
(SEARCH(M$15,D1)),M$15,"")&IF(ISNUMBER(SEARCH(M$16 ,D1)),M$16,"")&IF
(ISNUMBER(SEARCH(M$17,D1)),M$17,"")&IF(ISNUMBER(SE ARCH(M$18,D1)),M
$18,"")&IF(ISNUMBER(SEARCH(M$19,D1)),M$19,"")&IF(I SNUMBER(SEARCH(M
$20,D1)),M$20,"")&IF(ISNUMBER(SEARCH(M$21,D1)),M$2 1,"")&IF(ISNUMBER
(SEARCH(M$22,D1)),M$22,"")&IF(ISNUMBER(SEARCH(M$23 ,D1)),M$23,"")&IF
(ISNUMBER(SEARCH(M$24,D1)),M$24,"")
and it would leave a blank cell if none of the languages are present
in the corresponding cell of column D. Just copy this down as far as
you need to.
One thing to be wary of, though, is that a cell containing Germany (in
the address or company name) will match with German, so this could be
a bit misleading.
Hope this helps.
Pete
On Feb 21, 1:36*am, Barbie wrote:
Hello.
I have a large spreadsheet that lists many text strings in a single column.
|