formulae problem confused?

drag-driver

Board Regular
Joined
Feb 18, 2002
Messages
91
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
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
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
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,213,513
Messages
6,114,064
Members
448,545
Latest member
kj9

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
Back
Top