Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you create code to look at +/- a number

Status
Not open for further replies.

wafs

Technical User
Jan 17, 2006
112
US
Is it possible to write code where a forumla or if statement looks at +/- a number.

Say I run a test that gives me 44 for an answer. I need this to check the standards and if it is more or less then 2 of the standard, I will need an error message.

Standard range is 36 and 40, need to look at these (which are in different rows) and give me an error message.

Any suggestions or is this not possible.
 
not sure i fully understand what you're asking but this might be the way to go

if test > standard + 2 OR test < standard - 2 then
error message
end if

;-)
If a man says something and there are no women there to hear him, is he still wrong? [ponder]
How do I get the best answers?
 
That looks like what I'm shooting for, I was just not sure if that would work. Thanks for the suggestion and I will let you know if it works.
 
As standard is a range (36-40):
If answer > standardmax + 2 Or answer < standardmin - 2 Then

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
My range are in seperate rows

A
38
39
40
41
42

So I have soemthing like this

I vlookup the answer
standard = sheets(destsh).range(bolt(1))
if answer > bolt(1) + 2 or answer< bolt(1) -2 then



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top