formulae problem confused?
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: formulae problem confused?

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    i am testing a cell which contains either a number between 0 and 9 and if it contains zero to return true and return false if it contains 1:9 or if it is blank. The problem is it returns true not only when it contains zero but even if the cell is blank.

    any help much apreciated

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    Ahmedabad Gujarat
    Posts
    303
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Sub selecttruefalse()

    If IsEmpty(ActiveCell) Then
    ActiveCell = False
    Exit Sub
    End If

    Select Case ActiveCell
    Case 1 To 9
    ActiveCell = False
    Case Is = 0
    ActiveCell = True
    End Select

    End Sub


    ni****h desai
    http://www.pexcel.com


  3. #3
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-16 07:54, drag-driver wrote:
    i am testing a cell which contains either a number between 0 and 9 and if it contains zero to return true and return false if it contains 1:9 or if it is blank. The problem is it returns true not only when it contains zero but even if the cell is blank.

    any help much apreciated
    =NOT(OR(A1,ISBLANK(A1)))

    [ This Message was edited by: Mark W. on 2002-04-16 08:27 ]

  4. #4
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    81,767
    Post Thanks / Like
    Mentioned
    11 Post(s)
    Tagged
    1 Thread(s)

    Default

      
    On 2002-04-16 07:54, drag-driver wrote:
    i am testing a cell which contains either a number between 0 and 9 and if it contains zero to return true and return false if it contains 1:9 or if it is blank. The problem is it returns true not only when it contains zero but even if the cell is blank.

    any help much apreciated
    =(LEN(A1)=1)*(A1=0)

    produces either 1 or 0 instead of TRUE or FALSE repectively (1=TRUE,0=FALSE).

    If you rather want to see a logical value as result, use:

    =AND((LEN(A1)=1)*(A1=0))

    Aladin

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com