ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Checking for just spaces (https://www.excelbanter.com/excel-discussion-misc-queries/100121-checking-just-spaces.html)

Brad

Checking for just spaces
 
In conditionally formating I want to check if the cell has just spaces

I used the following logic

if the length of the cell is greater than zero (multiply) if the length of
the trimmed cell = 0. if both of these conditions are true - turn the cell
red - otherwise leave alone. This works - however is there an easier way to
do this?

Barb Reinhardt

Checking for just spaces
 
Try this is your conditional format

=AND(LEN(B15)0,LEN(TRIM(B15))=0)

I selected B15 and put a couple of spaces in it.


"Brad" wrote:

In conditionally formating I want to check if the cell has just spaces

I used the following logic

if the length of the cell is greater than zero (multiply) if the length of
the trimmed cell = 0. if both of these conditions are true - turn the cell
red - otherwise leave alone. This works - however is there an easier way to
do this?


Dave Peterson

Checking for just spaces
 
Or (dropping the len() bit):

=AND(LEN(B15)0,TRIM(B15)="")



Barb Reinhardt wrote:

Try this is your conditional format

=AND(LEN(B15)0,LEN(TRIM(B15))=0)

I selected B15 and put a couple of spaces in it.

"Brad" wrote:

In conditionally formating I want to check if the cell has just spaces

I used the following logic

if the length of the cell is greater than zero (multiply) if the length of
the trimmed cell = 0. if both of these conditions are true - turn the cell
red - otherwise leave alone. This works - however is there an easier way to
do this?


--

Dave Peterson

Brad

Checking for just spaces
 
Barb,

Thanks - That works and is essentially what I did - I compared the
=(AND(LEN(B15)0,LEN(TRIM(B15))=0)*1)=1 - your way is slightly easier.
However, is there an easier way of doing this??


"Barb Reinhardt" wrote:

Try this is your conditional format

=AND(LEN(B15)0,LEN(TRIM(B15))=0)

I selected B15 and put a couple of spaces in it.


"Brad" wrote:

In conditionally formating I want to check if the cell has just spaces

I used the following logic

if the length of the cell is greater than zero (multiply) if the length of
the trimmed cell = 0. if both of these conditions are true - turn the cell
red - otherwise leave alone. This works - however is there an easier way to
do this?



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com