Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 7
Default IF Statement accepting only positive values

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 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?

Thanks,
Amin
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 153
Default IF Statement accepting only positive values

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", B10)
(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 "B10" to "B1=0")

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

Finally, click "OK"

Hope this helps getting started.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Subtracting positive amts from negative and positive from positive bwbmom Excel Worksheet Functions 3 February 12th 10 03:15 PM
Protected sheet accepting values from List anandmr65 Excel Discussion (Misc queries) 3 February 15th 06 02:43 PM
Formula to make Negative Values Positive & Positive Values Negative? mustard Excel Discussion (Misc queries) 4 September 26th 05 10:05 PM
Pivot table page filter not accepting multiple values. Workaround? jco Excel Worksheet Functions 2 September 25th 05 09:35 PM
... Count, <<< Positive Values minus Negative Values >>> ... Dr. Darrell Excel Worksheet Functions 4 September 8th 05 01:36 PM


All times are GMT +1. The time now is 01:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"