hi;
I have this sheet that I am making where there are 5 test results, each with
3 possible inputs. I am using optionbuttons to enter the results. So I end up
with a table that looks something like this:
true false false
true false false
true false false
true false false
true false false
Where true values could swap with either of the false values in each row.
Now for my application I need to read these results to get an output, so
there are quite a few possible combinations, like 250 if I calculated right!
There are cases though that will give the same results so like, if assuming
we start at a1, I could have only one result if a1=true and b2=true,
regardless of the other three rows values, so this reduces the number of
outcomes quite a lot.
I have used if statements for most of the basic results but the whole 7
bracket limit issue is a bit of a problem for more specific cases. I am
familiar with vlookup and referencing a lookup table, but checking 15
true/false values at once seems like a long way around.
eg. vlookup(a1amp;a2amp;a3amp;b1...e3,reference table,2,0)
then in the reference column 1 will have all possible results
eg. truetruefalsetrue...(up to 15th true/false entry) and column 2 will have
the text to display following each outcome.
This is definitely possible but is this the best way to go about it or is
there an easier method??
Seems more that you have (2^3)=8 possible combinations for each row * 5 rows,
or 8^5 combinations = 32,768 combinations.
So..how are you trying to summarize/use this data?
quot;CraigSAquot; wrote:
gt; hi;
gt;
gt; I have this sheet that I am making where there are 5 test results, each with
gt; 3 possible inputs. I am using optionbuttons to enter the results. So I end up
gt; with a table that looks something like this:
gt;
gt; true false false
gt; true false false
gt; true false false
gt; true false false
gt; true false false
gt; Where true values could swap with either of the false values in each row.
gt;
gt; Now for my application I need to read these results to get an output, so
gt; there are quite a few possible combinations, like 250 if I calculated right!
gt; There are cases though that will give the same results so like, if assuming
gt; we start at a1, I could have only one result if a1=true and b2=true,
gt; regardless of the other three rows values, so this reduces the number of
gt; outcomes quite a lot.
gt;
gt; I have used if statements for most of the basic results but the whole 7
gt; bracket limit issue is a bit of a problem for more specific cases. I am
gt; familiar with vlookup and referencing a lookup table, but checking 15
gt; true/false values at once seems like a long way around.
gt; eg. vlookup(a1amp;a2amp;a3amp;b1...e3,reference table,2,0)
gt; then in the reference column 1 will have all possible results
gt; eg. truetruefalsetrue...(up to 15th true/false entry) and column 2 will have
gt; the text to display following each outcome.
gt; This is definitely possible but is this the best way to go about it or is
gt; there an easier method??
CraigSA
Questions:
1)Do you want the combination of Col_A and Col_B to count as one value,
resulting in only 4 options (T/T, T/F, F/T, FF)?
2)Do you want to match the entire matrix and find a corresponding value for
that configuration?
3)What values do you want associated with the TRUE/FALSE combinations?
***********
Regards,
Ron
XL2002, WinXPquot;CraigSAquot; wrote:
gt; hi;
gt;
gt; I have this sheet that I am making where there are 5 test results, each with
gt; 3 possible inputs. I am using optionbuttons to enter the results. So I end up
gt; with a table that looks something like this:
gt;
gt; true false false
gt; true false false
gt; true false false
gt; true false false
gt; true false false
gt; Where true values could swap with either of the false values in each row.
gt;
gt; Now for my application I need to read these results to get an output, so
gt; there are quite a few possible combinations, like 250 if I calculated right!
gt; There are cases though that will give the same results so like, if assuming
gt; we start at a1, I could have only one result if a1=true and b2=true,
gt; regardless of the other three rows values, so this reduces the number of
gt; outcomes quite a lot.
gt;
gt; I have used if statements for most of the basic results but the whole 7
gt; bracket limit issue is a bit of a problem for more specific cases. I am
gt; familiar with vlookup and referencing a lookup table, but checking 15
gt; true/false values at once seems like a long way around.
gt; eg. vlookup(a1amp;a2amp;a3amp;b1...e3,reference table,2,0)
gt; then in the reference column 1 will have all possible results
gt; eg. truetruefalsetrue...(up to 15th true/false entry) and column 2 will have
gt; the text to display following each outcome.
gt; This is definitely possible but is this the best way to go about it or is
gt; there an easier method??
No there are only 3 combinations for each row (TFF, FTF, FFT) only one of the
three can be true because each row is linked to a group of option buttons.
so thats 3^5 right?
Anyway, I'm using the data to give results of Hepatitis B virus testing. so
colunm a is quot;Positivequot;, b is quot;Negativequot;, c is quot;No resultquot;. and there are 5
different tests. Now for each combination of test results there is a
different diagnosis.
Say if all the tests are negative then result is quot;Non-infectiousquot;. but if a1
is positive then there could be a number of different outcomes depending on
the results of other tests.
I was thinking of using vlookup with a reference table so that the outcome
for one set would look like: eg. TFF,FTF,TFF,TFF,FFT ;
and then my result would be something like: Chronic precore infection ;
I was just wondering if there would be a better way of getting results
because doing things this way will force me to make a lookup table thats 100
rows long and this could get confusing, with each entry consisting of a
combination of 15 T/F states and it would take time to set this up.
I can use a few if statements in between for don't care combinations like:
if(and(a1,b1),quot;my resultquot;,quot;vlookup(....)quot;)
because if these 2 are positive it doesn't matter what the other three test
results are.
Is ther a way to ake the vlookup input an array istead of using amp;? so i
would have
vlookup(a1:c5,lookup table,2,0)
instead of
vlookup(a1amp;b1amp;c1amp;a2amp;b2amp;c2amp;a3amp;b3amp;c3amp;a4amp;b4amp;c4amp;a5amp;b5amp; c5, ..... )
When i try this I get #value.
Or is there another formula i can use to make the whole process easier?
Hope that clears things up a bit.
quot;Duke Careyquot; wrote:
gt; Seems more that you have (2^3)=8 possible combinations for each row * 5 rows,
gt; or 8^5 combinations = 32,768 combinations.
gt;
gt; So..how are you trying to summarize/use this data?I'm using an old version 2000.
other info is in my reply to Duke.
thanx
quot;Ron Coderrequot; wrote:
gt; CraigSA
gt;
gt; Questions:
gt; 1)Do you want the combination of Col_A and Col_B to count as one value,
gt; resulting in only 4 options (T/T, T/F, F/T, FF)?
gt;
gt; 2)Do you want to match the entire matrix and find a corresponding value for
gt; that configuration?
gt;
gt; 3)What values do you want associated with the TRUE/FALSE combinations?
gt;
gt; ***********
gt; Regards,
gt; Ron
gt;
gt; XL2002, WinXP
gt;CraigSA
See if this gets you headed in the right direction:
Since it seems that you are only interested in the location of T's in the
3X5 matrix, use this technique to convert the postions to a numeric text
string:
For T's and F's in A1:C5
D1:
=MOD(SEARCH(quot;Tquot;,A1amp;B1amp;C1amp;quot;Tquot;),4)amp;MOD(SEARCH(quot;Tquot;,A2 amp;B2amp;C2amp;quot;Tquot;),4)amp;MOD(SEARCH(quot;Tquot;,A3amp;B3amp;C3amp;quot;Tquot;),4)amp;MOD (SEARCH(quot;Tquot;,A4amp;B4amp;C4amp;quot;Tquot;),4)amp;MOD(SEARCH(quot;Tquot;,A5amp;B5amp; C5amp;quot;Tquot;),4)
Using that fomrula this configuration:
FFF
FFF
FFT
TFF
FTF
Becomes: 00312
Is that something you can work with?
***********
Regards,
Ron
XL2002, WinXPquot;CraigSAquot; wrote:
gt; I'm using an old version 2000.
gt; other info is in my reply to Duke.
gt; thanx
gt;
gt; quot;Ron Coderrequot; wrote:
gt;
gt; gt; CraigSA
gt; gt;
gt; gt; Questions:
gt; gt; 1)Do you want the combination of Col_A and Col_B to count as one value,
gt; gt; resulting in only 4 options (T/T, T/F, F/T, FF)?
gt; gt;
gt; gt; 2)Do you want to match the entire matrix and find a corresponding value for
gt; gt; that configuration?
gt; gt;
gt; gt; 3)What values do you want associated with the TRUE/FALSE combinations?
gt; gt;
gt; gt; ***********
gt; gt; Regards,
gt; gt; Ron
gt; gt;
gt; gt; XL2002, WinXP
gt; gt;
gt;
Assuming you can work with the 5-number code my previous post suggested,
here's a more concise formula for generating it:
D1: =RIGHT(100000 SUMPRODUCT((A1:C5=quot;Tquot;)*COLUMN(A1:C5) *(10^(5-ROW(A1:C5)))),5)
Or...if a basic numeric value would work for you:
D1: =SUMPRODUCT((A1:C5=quot;Tquot;)*COLUMN(A1:C5)*(10^(5-ROW(A1:C5))))
Either of those approaches could be used as the lookup value in a table.
I hope that helps?
***********
Regards,
Ron
XL2002, WinXPquot;Ron Coderrequot; wrote:
gt; CraigSA
gt;
gt; See if this gets you headed in the right direction:
gt;
gt; Since it seems that you are only interested in the location of T's in the
gt; 3X5 matrix, use this technique to convert the postions to a numeric text
gt; string:
gt;
gt; For T's and F's in A1:C5
gt;
gt; D1:
gt; =MOD(SEARCH(quot;Tquot;,A1amp;B1amp;C1amp;quot;Tquot;),4)amp;MOD(SEARCH(quot;Tquot;,A2 amp;B2amp;C2amp;quot;Tquot;),4)amp;MOD(SEARCH(quot;Tquot;,A3amp;B3amp;C3amp;quot;Tquot;),4)amp;MOD (SEARCH(quot;Tquot;,A4amp;B4amp;C4amp;quot;Tquot;),4)amp;MOD(SEARCH(quot;Tquot;,A5amp;B5amp; C5amp;quot;Tquot;),4)
gt;
gt; Using that fomrula this configuration:
gt; FFF
gt; FFF
gt; FFT
gt; TFF
gt; FTF
gt;
gt; Becomes: 00312
gt;
gt; Is that something you can work with?
gt; ***********
gt; Regards,
gt; Ron
gt;
gt; XL2002, WinXP
gt;
gt;
gt; quot;CraigSAquot; wrote:
gt;
gt; gt; I'm using an old version 2000.
gt; gt; other info is in my reply to Duke.
gt; gt; thanx
gt; gt;
gt; gt; quot;Ron Coderrequot; wrote:
gt; gt;
gt; gt; gt; CraigSA
gt; gt; gt;
gt; gt; gt; Questions:
gt; gt; gt; 1)Do you want the combination of Col_A and Col_B to count as one value,
gt; gt; gt; resulting in only 4 options (T/T, T/F, F/T, FF)?
gt; gt; gt;
gt; gt; gt; 2)Do you want to match the entire matrix and find a corresponding value for
gt; gt; gt; that configuration?
gt; gt; gt;
gt; gt; gt; 3)What values do you want associated with the TRUE/FALSE combinations?
gt; gt; gt;
gt; gt; gt; ***********
gt; gt; gt; Regards,
gt; gt; gt; Ron
gt; gt; gt;
gt; gt; gt; XL2002, WinXP
gt; gt; gt;
gt; gt;
Hi Ron,
Your suggestion looks good. I ran out of time though and ended up creating
my table with the t/f's. eg. tff,fft,ftf,fft,tff (for like 100 entries)
It got a bit confusing at times as I'm sure you can imagine. I think I'll
change it though to the numeric format as this would be a lot easier to
follow and type out.
Thanx for the help.
- Nov 21 Wed 2007 20:40
vlookup vs. if, help needed
close
全站熱搜
留言列表
發表留言