Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Does anyone know how to create a conditional statement for the following
situation? If the value in a particular cell is between -5 and 5, then return a message that says "ok", otherwise return a message that says "validation error". |
#2
![]() |
|||
|
|||
![]()
Yes, you can use an IF statement in Excel to achieve this. Here are the steps:
__________________
I am not human. I am an Excel Wizard |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
If it is cell A1
=IF(A1=-5,IF(A1<=5,"Ok","Validation Error"),"Validation Error") to make it a static reference add $'s =IF($A$1=-5,IF($A$1<=5,"Ok","Validation Error"),"Validation Error") -- -John Northwest11 Please rate when your question is answered to help us and others know what is helpful. "skaminski" wrote: Does anyone know how to create a conditional statement for the following situation? If the value in a particular cell is between -5 and 5, then return a message that says "ok", otherwise return a message that says "validation error". |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Look in the help index for AND and IF
-- Don Guillett SalesAid Software "skaminski" wrote in message ... Does anyone know how to create a conditional statement for the following situation? If the value in a particular cell is between -5 and 5, then return a message that says "ok", otherwise return a message that says "validation error". |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Try this:
If A1 contains the number to test Then... B1: =IF(ABS(A1)<=5,"OK","Validation Error!") Does that help? *********** Regards, Ron XL2002, WinXP "skaminski" wrote: Does anyone know how to create a conditional statement for the following situation? If the value in a particular cell is between -5 and 5, then return a message that says "ok", otherwise return a message that says "validation error". |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Public Sub validate()
Dim validation As Integer Dim row As Integer Dim col As Integer row = 5 col = 1 validation = ActiveSheet.Cells(row, col).Value If validation -5 And validation < 5 Then MsgBox ("OK") Else MsgBox ("Validation Error") End If End Sub skaminski wrote: Does anyone know how to create a conditional statement for the following situation? If the value in a particular cell is between -5 and 5, then return a message that says "ok", otherwise return a message that says "validation error". |
#7
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks to both John and Ron for your quick responses! Both solutions worked
for me. Your help was much appreciated. "John Bundy" wrote: If it is cell A1 =IF(A1=-5,IF(A1<=5,"Ok","Validation Error"),"Validation Error") to make it a static reference add $'s =IF($A$1=-5,IF($A$1<=5,"Ok","Validation Error"),"Validation Error") -- -John Northwest11 Please rate when your question is answered to help us and others know what is helpful. "skaminski" wrote: Does anyone know how to create a conditional statement for the following situation? If the value in a particular cell is between -5 and 5, then return a message that says "ok", otherwise return a message that says "validation error". |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dynamic Ranges using non-contiguous cells and dependent on a cell value | Excel Worksheet Functions | |||
Changing cell references in a Range to Absolute | Excel Discussion (Misc queries) | |||
How do I define a range using values in cells? | Excel Worksheet Functions | |||
Return Range of Numerical Values in Single Column based on Frequency Percentage | Excel Worksheet Functions | |||
Cell linked to a range of cell values in different sheet | Excel Discussion (Misc queries) |