Require help with TRIM function

shahs

New Member
Joined
Oct 4, 2006
Messages
1
I have already an argument in conditional formatting which is

Formula is =LEN(C13)>64

This is to alert the user that they have exceeded the 64 char limit, but I now need to add to this argument to include the TRIM function, the TRIM function should alert when there are spaces before or after the text.

What I need to know is how do I combine the LEN and TRIM statment in one conditional statement. I only have two condition formatting options and the other one is used, hence why I need to combine the two statements in to one argument.

Thanks.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

NBVC

Well-known Member
Joined
Aug 31, 2005
Messages
5,828
=OR(LEN(C13)>64,LEN(TRIM(C13))<>LEN(C13))

edit: forgot to put Len() function around Trim() function.
 

fairwinds

MrExcel MVP
Joined
May 15, 2003
Messages
8,638
Welcome to the board!

Try:

=(LEN(C13)>64)+(LEN(C13)<>LEN(TRIM(C13)))
 

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
Hi

Try:

Code:
=OR(LEN(C13)>64,LEN(TRIM(C13))<LEN(C13))

This isn't perfect, as if your user has intentionally inserted a double space within whatever text he's written, TRIM will highlight this as a problem.

Best regards

Richard
 

Forum statistics

Threads
1,136,925
Messages
5,678,601
Members
419,774
Latest member
MooseWinooski

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top