Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find blank cells containing spaces

Status
Not open for further replies.

doctorswamp

Technical User
Jul 15, 2003
133
GB
Hi

Need to identify cells that look blank but may contain spaces.

If(Isblank...) doesn't flag them.

Thanks

PS sorry if this is an old chestnut, couldn't see it in faq
 
oops, there should be a space between the quotes:

=IF(A1=" "),dosomething,donothing


Peace!! [americanflag] [peace] [americanflag]

Mike

Didn't get the answers that you wanted? Then . . . Click Here
 
You can try conditional formatting with 'Formula is' and formula =(FIND(" ",A1)>0) (no $-type reference, selected region starts in A1 - active cell).

combo
 
=IF(ISBLANK(A1),"","not blank")

This will flag if A1 = a space or if A1 = multiple spaces.

 
Sorry fellas, should have been a bit clearer with my question.

The exercise is part of data validation on a column that may contain reference numbers or blanks.

If there's a number in say cell A3 then a formula in B3 needs to show the number. If A3 is blank then B3 should show "Empty".

The problem was that people sometimes deleted entries in column A by hitting the spacebar, so the formula =If(Isblank(A3)=true,"Empty",A3) was giving a blank, not "Empty".



 
What if there is text in A3, what do you want displayed?

How about:

=IF(ISNUMBER(A1),A1,"Not a number")

 

If this is an excersize in data validation, why not use it:

1. Select all pertaining cells in column A

2. Select Data->Validation...

3. Insert under Allow: Custom

4. Enter under Formula: "=ISNUMBER(A3)"

This way you can eliminate the B column altogether!

If you want to keep the B column Check (based on your formula):

=IF(OR(ISBLANK(A3),A3=" "),"Empty",A3)



Peace!! [americanflag] [peace] [americanflag]

Mike

Didn't get the answers that you wanted? Then . . . Click Here
 
Hi Bowers74, Lilliabeth & Combo

Thanks for the combined thoughts which pointed me in the right direction.

What seems to work ok is use in say cell B3

If(LEN(TRIM(A3)>0,A3,"blank")

This takes care of any leading or trailing spaces and shows either the value or text in A3 whether or not it has spaces, or 'blank' if the cell looks empty but might have spaces in it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top