Solved Lesser than and Greater than

December 8, 2016 at 08:58:19
Specs: Windows 7
Hello,

I am trying to create a formula with the following rules:

a) If Lesser than 60 and greater than 140, give a value of PASS & FAIL.
For example: If we received value as 58 thn it shown as FAIL and if we received value as 140 then it shown as PASS


See More: Lesser than and Greater than

Report •

#1
December 8, 2016 at 09:26:32
Is this for use in a programming language? If so, which?

Is it for use in some software, as for example a database program or a spreadsheet? If so, which?

Also, what would happen if a value is 60-140 ?

Nigel

Wind slow

message edited by Nigel Spike


Report •

#2
December 8, 2016 at 12:35:58
✔ Best Answer
Programmers have to be very nitpicky. I'm going to be very nitpicky,
just because.

> I am trying to create a formula with the following rules:
> a) If Lesser than 60 and greater than 140, give a value of PASS & FAIL.
> For example: If we received value as 58 thn it shown as FAIL and if we
> received value as 140 then it shown as PASS

You listed one rule, not multiple rules. So there was no need to
label rule "a" as such. Or is "a" the name of the numerical variable?

There was no reason to capitalize the first letter of the word "lesser".
You didn't do it with the word "greater".

In this situation, the correct parallel to "greater than" is "less than",
not "lesser than".

You made it sound like you want to test for a value which is less
than 60 and greater than 140. Such a value obviously doesn't exist.

You made it sound like you want to give something a value
of "PASS & FAIL".

You meant that numerical values less than 60 should result
in output of one string, while numerical values greater than
140 should result in output of another string value. But the
way you expressed it, you made it sound like values less than
60 should output "PASS" while values greater than 140 should
output "FAIL". Your examples show that you want it to be
the other way around.

Your second example has a value of exactly 140, not greater
than 140. If you want 140 to be a passing value, then you need
to say something like "If greater than or equal to 140" or
"If greater than 139" or "If greater than 139.5". Similarly if you
also want a value of exactly 60 to be classed as "FAIL".

b$ = ""
If a =< 60 then b$ = "FAIL" else if a >= 140 then b$ = "PASS"

By setting the output string b$ = "" in the first line, nothing will be
output if the value of a is greater than 60 and less than 140.

The correct formulation depends on the language you are using,
of course.

-- Jeff, in Minneapolis


Report •

#3
December 13, 2016 at 11:16:18
IT is quite interesting formula, thanks.

Report •
Related Solutions


Ask Question