Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 18
Default Check if there is a space in a string as test for IF

I need to check if there is a space in a string(Cell) and use the result as a test in an if statement.

I tried using search() but if there is no space there is no result so I get #VALUE in my formula cell.
=IF(SEARCH(" ",G2),{split string at space},"FALSE")

Is there anything I can use that will get me a Boolean true false result that can be used?
  #2   Report Post  
Junior Member
 
Posts: 18
Default

I have found an answer.

If I enclose the search in an ISERR() then it works.

ISERR(SEARCH(" ",G2)) result of this is either TRUE or FALSE.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Check if there is a space in a string as test for IF

Hi,

Am Fri, 8 Mar 2013 14:41:53 +0000 schrieb Caveman1957:

I need to check if there is a space in a string(Cell) and use the result
as a test in an if statement.

I tried using search() but if there is no space there is no result so I
get #VALUE in my formula cell.
=IF(SEARCH(" ",G2),{split string at space},"FALSE")

Is there anything I can use that will get me a Boolean true false result
that can be used?


you can use TextToColumns with space as deliniter. If there is a space
the string will be split.
Or use formula:
=IF(ISNUMBER(FIND(" ",G2)),{split string at space},"False")


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Test to see if cell contains a space? Rick[_10_] Excel Worksheet Functions 4 April 2nd 23 06:45 PM
Test for string of space chars? Robert Crandal[_2_] Excel Programming 4 December 30th 10 08:29 PM
Number of space in a string [email protected] Excel Discussion (Misc queries) 5 November 8th 06 11:15 PM
how to remove a space after a string? elaine Excel Programming 3 June 9th 06 03:00 PM
Check Drive Space Charles Excel Programming 3 October 6th 04 07:12 PM


All times are GMT +1. The time now is 08:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"