ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Dataval question (https://www.excelbanter.com/excel-programming/331676-re-data-val-question.html)

rjamison

Dataval question
 
Hi Chip. Thanks for the formula. One folluw up question - Can we
combine
the two formulas into one, so as to not allow commas OR more than one
space
in the cell?

So essentially, combine:
=(LEN(B5)-LEN(SUBSTITUTE(B5," ","")))<2 and
=IF(ISERROR(FIND(",",B5)),1,0)

Thanks!!


"Chip Pearson" wrote in message
...

Use a validation formula like

=(LEN(B5)-LEN(SUBSTITUTE(B5," ","")))<2

Note that there is one space between the first set of quote
marks, and nothing between the second set of quote marks.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Steph" wrote in message
...


I use the below formula in datavalidation to not allow commas
in the cell.
Is there a way to add to this to also not allow more than 1
blank space in
the cell? Thank you!!

=IF(ISERROR(FIND(",",B5)),1,0)








All times are GMT +1. The time now is 06:18 AM.

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