IF Statement accepting only positive values

A

Ada33

Hi guys,

I assume this is going to have to be done through data validation.

In column A, I have text in cells A1:A10, in column B, I want to put i
a formula saying "If A1 contains 'test text', then only accept
positive number" and return an error if a negative number is attempte
to be typed in. How do I do this?

Thanks,
Ami
 
Z

zvkmpw

In column A, I have text in cells A1:A10, in column B, I want to put in
a formula saying "If A1 contains 'test text', then only accept a
positive number" and return an error if a negative number is attempted
to be typed in. How do I do this?

Select column B and in
Data > Data tools > Data Validation > Settings
put

Allow:
Custom

Formula:
=OR(A1<>"test text", B1>0)
(The post doesn't say what to do if zero is entered in column B.
The formula assumes it's lumped in with the negative; if not,
change "B1>0" to "B1>=0")

Then click the "Error Alert" tab and enter the desired error message.

Finally, click "OK"

Hope this helps getting started.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top