I just want to cut out words with 4 numbers, like years
ok, going by your revised specs above, I'll interpret it
to mean that you want to extract the first word only if
the text-string in cell D1 contains a 4 digit number, and
return a blank [""] if otherwise ..
The revised "ugly" formula below seems to work for me,
when put in say D2:
=IF(ISERROR(AND(VALUE((LEFT(TRIM(D1),SEARCH(" ",TRIM(D1))-
1)))>=1000,VALUE((LEFT(TRIM(D1),SEARCH(" ",TRIM(D1))-1)))
<=9999)),"",IF(AND(VALUE((LEFT(TRIM(D1),SEARCH(" ",TRIM
(D1))-1)))>=1000,VALUE((LEFT(TRIM(D1),SEARCH(" ",TRIM(D1))-
1)))<=9999),MID(TRIM(D1),SEARCH(" ",TRIM(D1))+1,SEARCH
(" ",TRIM(D1),SEARCH(" ",TRIM(D1))+1)-SEARCH(" ",TRIM(D1))-
1),""))
--
Maybe a slightly "shortened" version of the above,
put in say D3:
=IF(ISERROR(_4D),"",IF(_4D,MID(TRIM(D1),SEARCH(" ",TRIM
(D1))+1,SEARCH(" ",TRIM(D1),SEARCH(" ",TRIM(D1))+1)-SEARCH
(" ",TRIM(D1))-1),""))
where _4D is a named* range referring to:
=AND(VALUE((LEFT(TRIM(Sheet1!$D$1),SEARCH(" ",TRIM(Sheet1!
$D$1))-1)))>=1000,VALUE((LEFT(TRIM(Sheet1!$D$1),SEARCH
(" ",TRIM(Sheet1!$D$1))-1)))<=9999)
*named range created via: Insert > Name > Define
--
The above formulas will return blank [""]
if D1 contains, for example:
Brande Blue Widget
2 Brande Blue Widget
20 Brande Blue Widget
200 Brande Blue Widget
The above formulas will return the 1st word "Brande"
if D1 contains, for example:
1999 Brande Blue Widget
2000 Brande Blue Widget
2001 Brande Blue Widget
2002 Brande Blue Widget
etc
Use of TRIM() in the formula helps to remove any
extraneous "invisible" leading or trailing spaces
in D1's contents which might otherwise produce
errors in the desired results
Hope this gives you what you're after ..