+ Reply to Thread
Results 1 to 5 of 5

Data>val question

  1. #1
    Steph
    Guest

    Data>val question

    I use the below formula in data>validation 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)



  2. #2
    Chip Pearson
    Guest

    Re: Data>val question

    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" <verysmallrox@yahoo.com> wrote in message
    news:%23ItUTMRRFHA.1096@tk2msftngp13.phx.gbl...
    >I use the below formula in data>validation 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)
    >
    >




  3. #3
    Steph
    Guest

    Re: Data>val 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" <chip@cpearson.com> wrote in message
    news:uJ1ckbRRFHA.1172@TK2MSFTNGP12.phx.gbl...
    > 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" <verysmallrox@yahoo.com> wrote in message
    > news:%23ItUTMRRFHA.1096@tk2msftngp13.phx.gbl...
    > >I use the below formula in data>validation 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)
    > >
    > >

    >
    >




  4. #4
    Dana DeLouis
    Guest

    Re: Data>val question

    I think this should work for you.
    =AND((LEN(B5)-LEN(SUBSTITUTE(B5," ","")))<2,ISERROR(FIND(",",B5)))

    Note that you do not need IF( ) with ISERROR because that function returns
    True/False anyway.
    HTH.
    --
    Dana DeLouis
    Win XP & Office 2003


    "Steph" <verysmallrox@yahoo.com> wrote in message
    news:ed25YGbRFHA.904@tk2msftngp13.phx.gbl...
    > 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" <chip@cpearson.com> wrote in message
    > news:uJ1ckbRRFHA.1172@TK2MSFTNGP12.phx.gbl...
    >> 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" <verysmallrox@yahoo.com> wrote in message
    >> news:%23ItUTMRRFHA.1096@tk2msftngp13.phx.gbl...
    >> >I use the below formula in data>validation 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)
    >> >
    >> >

    >>
    >>

    >
    >




  5. #5
    Steph
    Guest

    Re: Data>val question

    Perfect. Thank you!

    "Dana DeLouis" <delouis@bellsouth.net> wrote in message
    news:%2346wmcbRFHA.252@TK2MSFTNGP12.phx.gbl...
    > I think this should work for you.
    > =AND((LEN(B5)-LEN(SUBSTITUTE(B5," ","")))<2,ISERROR(FIND(",",B5)))
    >
    > Note that you do not need IF( ) with ISERROR because that function returns
    > True/False anyway.
    > HTH.
    > --
    > Dana DeLouis
    > Win XP & Office 2003
    >
    >
    > "Steph" <verysmallrox@yahoo.com> wrote in message
    > news:ed25YGbRFHA.904@tk2msftngp13.phx.gbl...
    > > 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" <chip@cpearson.com> wrote in message
    > > news:uJ1ckbRRFHA.1172@TK2MSFTNGP12.phx.gbl...
    > >> 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" <verysmallrox@yahoo.com> wrote in message
    > >> news:%23ItUTMRRFHA.1096@tk2msftngp13.phx.gbl...
    > >> >I use the below formula in data>validation 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)
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1