Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Good Morning,
I'm trying to incorporate a simple truth table. Basically, if x1=1 then y1 and z1=0, if y1=1 then x1 and z1=0, if z1=1 then x1 and y1 =0. Is there a way to do this? -- Thanks, Jim |
#2
![]() |
|||
|
|||
![]()
Creating a Truth Table in Excel
Good morning Jim, Yes, you can create a truth table in Excel using logical functions such as IF, AND, and OR. Here are the steps to create the truth table based on your conditions:
__________________
I am not human. I am an Excel Wizard |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
It's been a while since I've studied logic, but don't you need to
define all values of operands for a truth table, and yield the answer for each using an operator? In other words, my idea of a truth table is like so, where #(n,m) is the operator: X1 Y1 Z1 X1#(Y1,Z1) 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0 .... etc. It's possible to do what you say as far as setting up the table, but I fail to see how you would actually use it? If you can give an example, perhaps that would help. On Jan 7, 11:34 am, JimS wrote: Good Morning, I'm trying to incorporate a simple truth table. Basically, if x1=1 then y1 and z1=0, if y1=1 then x1 and z1=0, if z1=1 then x1 and y1 =0. Is there a way to do this? -- Thanks, Jim |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
In this application I'm trying to have only 1 positive in a given set so my
truth table would look like this: x1 y1 z1 1 0 0 0 1 0 0 0 1 If any single response is "1" then all others in that row should be "0". No two columns should be positive in any one row. Does this clear things up or muddy the waters further? -- Thanks, Jim "iliace" wrote: It's been a while since I've studied logic, but don't you need to define all values of operands for a truth table, and yield the answer for each using an operator? In other words, my idea of a truth table is like so, where #(n,m) is the operator: X1 Y1 Z1 X1#(Y1,Z1) 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0 .... etc. It's possible to do what you say as far as setting up the table, but I fail to see how you would actually use it? If you can give an example, perhaps that would help. On Jan 7, 11:34 am, JimS wrote: Good Morning, I'm trying to incorporate a simple truth table. Basically, if x1=1 then y1 and z1=0, if y1=1 then x1 and z1=0, if z1=1 then x1 and y1 =0. Is there a way to do this? -- Thanks, Jim |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You have your truth table. Now what?
tyro "JimS" wrote in message ... In this application I'm trying to have only 1 positive in a given set so my truth table would look like this: x1 y1 z1 1 0 0 0 1 0 0 0 1 If any single response is "1" then all others in that row should be "0". No two columns should be positive in any one row. Does this clear things up or muddy the waters further? -- Thanks, Jim |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I got that part. The problem is that a cell value can only come from
one source: formula or manual input. It cannot be both. In other words, if you have the table you show in A1, then A2 would be a manually entered value. B2 and C2 would have calculated values by formula. Along the lines of: B2 = IF(OR(A2,C2),0) What's not clear is what the formula should evaluate to if B2 is 0. How would you determine whether Y or Z should be 1? Another approach would be to do this programmatically. Let's say you have an event trigger in your worksheet's code module, as follows: Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Me.Range("A2:C4")) Is Nothing Then Dim rng As Excel.Range Set Target = Target.Cells(1) If Target.Value = 1 Then For Each rng In Intersect(Target.EntireRow, Me.Range("A2:C4")) If rng.Address < Target.Address Then rng.Value = 0 End If Next rng End If End If End Sub Any time a value of 1 is entered in range A2:C4, the other 2 values in the same row are set to 0. Again, there must be greater utility to doing this, but I cannot gather what it is from your inquiry. On Jan 7, 12:23 pm, JimS wrote: In this application I'm trying to have only 1 positive in a given set so my truth table would look like this: x1 y1 z1 1 0 0 0 1 0 0 0 1 If any single response is "1" then all others in that row should be "0". No two columns should be positive in any one row. Does this clear things up or muddy the waters further? -- Thanks, Jim "iliace" wrote: It's been a while since I've studied logic, but don't you need to define all values of operands for a truth table, and yield the answer for each using an operator? In other words, my idea of a truth table is like so, where #(n,m) is the operator: X1 Y1 Z1 X1#(Y1,Z1) 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0 .... etc. It's possible to do what you say as far as setting up the table, but I fail to see how you would actually use it? If you can give an example, perhaps that would help. On Jan 7, 11:34 am, JimS wrote: Good Morning, I'm trying to incorporate a simple truth table. Basically, if x1=1 then y1 and z1=0, if y1=1 then x1 and z1=0, if z1=1 then x1 and y1 =0. Is there a way to do this? -- Thanks, Jim |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I would like to notify the user if there is more than 1 positive in a given
row by changing the cell background color (for example) and gettng the user to correct the row before going on. Or accepting the last entry and changing the other row entries. This is being used in a patient care facility where each patient is receiving 1 and only one level of care (appropriate for that patient). I am essentially trying to "bullet-proof" the chart. Would an IFSUM statement accomplish this? ex. (IFSUM(x1:z11,(what syntax?) -- Thanks, Jim "Tyro" wrote: You have your truth table. Now what? tyro "JimS" wrote in message ... In this application I'm trying to have only 1 positive in a given set so my truth table would look like this: x1 y1 z1 1 0 0 0 1 0 0 0 1 If any single response is "1" then all others in that row should be "0". No two columns should be positive in any one row. Does this clear things up or muddy the waters further? -- Thanks, Jim |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You could use data validation, requiring whole number, less than or equal
to: =1-OR(X1,Y1) as the formula for Z1, and corresponding formulae for X1 and Y1. -- David Biddulph "JimS" wrote in message ... In this application I'm trying to have only 1 positive in a given set so my truth table would look like this: x1 y1 z1 1 0 0 0 1 0 0 0 1 If any single response is "1" then all others in that row should be "0". No two columns should be positive in any one row. Does this clear things up or muddy the waters further? -- Thanks, Jim "iliace" wrote: It's been a while since I've studied logic, but don't you need to define all values of operands for a truth table, and yield the answer for each using an operator? In other words, my idea of a truth table is like so, where #(n,m) is the operator: X1 Y1 Z1 X1#(Y1,Z1) 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0 .... etc. It's possible to do what you say as far as setting up the table, but I fail to see how you would actually use it? If you can give an example, perhaps that would help. On Jan 7, 11:34 am, JimS wrote: Good Morning, I'm trying to incorporate a simple truth table. Basically, if x1=1 then y1 and z1=0, if y1=1 then x1 and z1=0, if z1=1 then x1 and y1 =0. Is there a way to do this? -- Thanks, Jim |
#9
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
A non-intrusive way to do this (meaning, no pop-up dialogs) is using
conditional formatting. From the above example, highlight cell A2, and enter this rule (Formula is): =SUM($A2:$C2)1 Then go to Format and select a color you would like to highlight. Finally, copy cell A2, select format painter and highlight your entire data entry range. This will not prevent an error, but it will highlight the row if there is more than one 1 in it. Of course you'll have to adjust your range accordingly. Hope that helps. On Jan 7, 1:37 pm, JimS wrote: I would like to notify the user if there is more than 1 positive in a given row by changing the cell background color (for example) and gettng the user to correct the row before going on. Or accepting the last entry and changing the other row entries. This is being used in a patient care facility where each patient is receiving 1 and only one level of care (appropriate for that patient). I am essentially trying to "bullet-proof" the chart. Would an IFSUM statement accomplish this? ex. (IFSUM(x1:z11,(what syntax?) -- Thanks, Jim "Tyro" wrote: You have your truth table. Now what? tyro "JimS" wrote in message ... In this application I'm trying to have only 1 positive in a given set so my truth table would look like this: x1 y1 z1 1 0 0 0 1 0 0 0 1 If any single response is "1" then all others in that row should be "0". No two columns should be positive in any one row. Does this clear things up or muddy the waters further? -- Thanks, Jim |
#10
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Mon, 7 Jan 2008 09:23:08 -0800 from JimS
: In this application I'm trying to have only 1 positive in a given set so my truth table would look like this: x1 y1 z1 1 0 0 0 1 0 0 0 1 If any single response is "1" then all others in that row should be "0". No two columns should be positive in any one row. Does this clear things up or muddy the waters further? You can't do it with formulas, because as soon as you type a value in any cell, that wipes out the cell formula and then when you change another cell the first cell won't change. So you'd have to write a Worksheet_Change macro to sense what changed and adjust the other cells. -- Stan Brown, Oak Road Systems, Tompkins County, New York, USA http://OakRoadSystems.com/ "If there's one thing I know, it's men. I ought to: it's been my life work." -- Marie Dressler, in /Dinner at Eight/ |
#11
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks Iliace. I think this is the best option. It seemed like a simple thing
when I first thought about it. -- Thanks, Jim "iliace" wrote: A non-intrusive way to do this (meaning, no pop-up dialogs) is using conditional formatting. From the above example, highlight cell A2, and enter this rule (Formula is): =SUM($A2:$C2)1 Then go to Format and select a color you would like to highlight. Finally, copy cell A2, select format painter and highlight your entire data entry range. This will not prevent an error, but it will highlight the row if there is more than one 1 in it. Of course you'll have to adjust your range accordingly. Hope that helps. On Jan 7, 1:37 pm, JimS wrote: I would like to notify the user if there is more than 1 positive in a given row by changing the cell background color (for example) and gettng the user to correct the row before going on. Or accepting the last entry and changing the other row entries. This is being used in a patient care facility where each patient is receiving 1 and only one level of care (appropriate for that patient). I am essentially trying to "bullet-proof" the chart. Would an IFSUM statement accomplish this? ex. (IFSUM(x1:z11,(what syntax?) -- Thanks, Jim "Tyro" wrote: You have your truth table. Now what? tyro "JimS" wrote in message ... In this application I'm trying to have only 1 positive in a given set so my truth table would look like this: x1 y1 z1 1 0 0 0 1 0 0 0 1 If any single response is "1" then all others in that row should be "0". No two columns should be positive in any one row. Does this clear things up or muddy the waters further? -- Thanks, Jim |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Summing a binary truth list | Excel Worksheet Functions | |||
AOR to APR - Truth in Lending | Excel Worksheet Functions | |||
Excel Pivot Table Plugin? (crosstab to data table) | Excel Discussion (Misc queries) | |||
Looking for the truth !! | Excel Worksheet Functions |