 |
|
 |
 |
 |
 |
|
 |
 |
 |
 |
 |
philaddis Fordmods - Getting Side Ways
Posts: 672 Joined: 21 Dec 2004 Location: Perth WA, Australia
View User Gallery (0)
 |
Posted: Wed Apr 30, 2008 5:45 pm Post subject: What's wrong with this formula? |
|
|
=IF(J8 >0<3,1,0)
Basically looking for;
If data in cell referenced is greater than 0 but less than 3, answer should be 1, otherwise should return answer of 0.
It just doesn't work...... It only returns an answer of 0, no matter what I input.
If I pull out the >0 in the formula, the formula works, but I need that parameter in there to make the end data accurate.
Pulling my hair out now..... is there anyway to get two parameters in there?
It's excel too by the way if that matters. |
|
| Back to top |
|
 |
|
|
 |
 |
 |
 |
 |
basstrom_dave Fordmods - Smokin em up
Age:21 Posts: 228 Joined: 27 Jul 2005 Location: Adelaide SA, Australia
View User Gallery (0)
 |
Posted: Wed Apr 30, 2008 6:08 pm Post subject: |
|
|
try using AND operand in there, so essentially J8>0 AND J8<3
so the code is if(J8>8 && J8<3,1,0)
another way might be if(0<J8<3,1,0)
i'm not sure which way will work under excel but under c or java either way will work
hope it works for you |
|
| Back to top |
|
 |
|
|
 |
 |
 |
 |
 |
philaddis Fordmods - Getting Side Ways
Posts: 672 Joined: 21 Dec 2004 Location: Perth WA, Australia
View User Gallery (0)
 |
Posted: Wed Apr 30, 2008 7:02 pm Post subject: |
|
|
Thanks for the try mate.
I just tried both ways, and unfortunately, they both did the same thing mine did.....
Anyone else got any ideas? |
|
| Back to top |
|
 |
|
|
 |
 |
 |
 |
 |
x3ros Fordmods - Getting Side Ways
Age:26 Posts: 1168 Joined: 16 Aug 2005 Location: Cranbourne VIC, Australia
View User Gallery (0)
 |
Posted: Wed Apr 30, 2008 7:10 pm Post subject: |
|
|
=(J8>0)*(J8<3)
Maybe this will work ? |
|
| Back to top |
|
 |
|
|
 |
 |
 |
 |
 |
philaddis Fordmods - Getting Side Ways
Posts: 672 Joined: 21 Dec 2004 Location: Perth WA, Australia
View User Gallery (0)
 |
Posted: Wed Apr 30, 2008 8:00 pm Post subject: |
|
|
| x3ros wrote: | =(J8>0)*(J8<3)
Maybe this will work ? |
Mate, your a genius........ It worked.
Now if you could explain it to me that would be awesome..... 'cos to me... that makes no sense! |
|
| Back to top |
|
 |
|
|
 |
 |
 |
 |
 |
x3ros Fordmods - Getting Side Ways
Age:26 Posts: 1168 Joined: 16 Aug 2005 Location: Cranbourne VIC, Australia
View User Gallery (0)
 |
Posted: Wed Apr 30, 2008 8:42 pm Post subject: |
|
|
| philaddis wrote: | | x3ros wrote: | =(J8>0)*(J8<3)
Maybe this will work ? |
Mate, your a genius........ It worked.
Now if you could explain it to me that would be awesome..... 'cos to me... that makes no sense! |
Not a genius, just enjoy a challenge
You had the right idea, just the presentation wasn't quite right.
How it works...Logic Gates
ie =(J8>0)*(J8<3)
true=1, false=0
say the number is....2
=(J8>0)*(J8<3)
=(2>0)*(2<3)
=(true)*(true)
=(1)*(1)
= 1 * 1 = 1
= 1
say the number is.....6
=(J8>0)*(J8<3)
=(6>0)*(6<3)
=(true)*(false)
=(1)*(0)
= 1 * 0 = 0
= 0 |
|
| Back to top |
|
 |
|
|
 |
 |
 |
 |
 |
philaddis Fordmods - Getting Side Ways
Posts: 672 Joined: 21 Dec 2004 Location: Perth WA, Australia
View User Gallery (0)
 |
Posted: Wed Apr 30, 2008 9:11 pm Post subject: |
|
|
Right. I am pretty sure I get it.
I'm guessing the basis for that formula is built into the programing? ie true*true being 1, true * false being 0... etc |
|
| Back to top |
|
 |
|
|
 |
 |
 |
 |
 |
x3ros Fordmods - Getting Side Ways
Age:26 Posts: 1168 Joined: 16 Aug 2005 Location: Cranbourne VIC, Australia
View User Gallery (0)
 |
Posted: Wed Apr 30, 2008 10:27 pm Post subject: |
|
|
| philaddis wrote: | Right. I am pretty sure I get it.
I'm guessing the basis for that formula is built into the programing? ie true*true being 1, true * false being 0... etc |
Try to think of it more in terms of mathematics, computers don't see a 'true' or 'false' they are human words - the computer sees '1' or '0' and does the sums accordingly
So its not so much true*true=true, its really 1*1=1
And true*true will not always result in 'true' it depends on the operator used, essentially for that excel we used a 'AND' operator, which means both conditions must be true, to return a 'true' result
if we had applied that as an XOR instead of an AND, you would have gotten 'true' if your number was below 1, or above 2... and have gotten a 'false' (0) if it was between 0 and 3
however, that excel equation wasn't a AND statement in the true sense (because there was no 'AND' operator... e.g. AND, &&), it was a mathematical equation to emulate the function of an AND operator
confused yet ? |
|
| Back to top |
|
 |
|
|
 |
 |
 |
 |
 |
philaddis Fordmods - Getting Side Ways
Posts: 672 Joined: 21 Dec 2004 Location: Perth WA, Australia
View User Gallery (0)
 |
Posted: Wed Apr 30, 2008 10:29 pm Post subject: |
|
|
Yep...... but only totally.... so that's all good!
Thanks mate.... I'm just not up to the task with that sort of thing!  |
|
| Back to top |
|
 |
|
|
 |
 |
 |
 |
 |
phatba Fordmods - Smokin em up
Age:28 Posts: 293 Joined: 30 Sep 2007 Location: perth WA, Australia
View User Gallery (0)
 |
Posted: Thu May 01, 2008 1:27 am Post subject: |
|
|
does excel still use the "if then or" formula? the idea being somewhat
"=if J8 is >0 and <3 then 1, or = 0"
cant recall exactly been so long since i did excel at uni |
|
| Back to top |
|
 |
|
|
 |
 |
 |
 |
 |
basstrom_dave Fordmods - Smokin em up
Age:21 Posts: 228 Joined: 27 Jul 2005 Location: Adelaide SA, Australia
View User Gallery (0)
 |
Posted: Thu May 01, 2008 1:34 am Post subject: |
|
|
know it uses the if statement but its changed a bit i think, i did it last year, prefer MATLAB or writing a small program in C for maths stuff.
glad its sorted out now though |
|
| Back to top |
|
 |
|
|
 |
 |
 |
 |
 |
|
 |
| |
 |
|
|
|
|
| |
| (c)2002-2008 Matti Jones and Brad Evans |
[38 queries :: 0.04512 seconds ]
|
 |