Has anyone here ever written the Quine–McCluskey algorithm in VBA to minimize truth table equations to there simplest form.

Thanks, Blues

Thanks, Blues

- Code loop through two tables checking and altering
- Multiple ComboBox and Conditional Formating
- XNOR UDF using VBA?
- Logic functions...
- Logic Matrix or Logic Array
- Re;Computing Mathematics
- The following has caused me considerable embarassment..can anyone explain?
- Material Condition formula
- GIF image on web-page corrupts data fetched with Web Query
- Algorithm Matrix
- =Dec2bin can you increase the number bits please
- Material Condition formula
- Multiple Logical Operators
- The following has caused me considerable embarassment..can anyone explain?
- Decimal to binary
- Help with multiple if statements.
- Logic Values: T/F -> Y/N
- Storing static formulas that can execute
- Multiple Conditions Formula
- Tips for Minimizing size of Pivot Table workbooks
- Minimize Pivot Table Field
- Tips for Minimizing size of Pivot Table workbooks
- Pivot table Data Range made up of data on multiple sheets

Do you know how to generate a binary truth table for N items, I mean the 2^N combinations, for example.

N=2

Truth table (in different cells)

A-B

0--0

0--1

1--0

1--1

But if N is greater than 15, I´ll modify to evaluate the code in parts.

because the matrix will be bigger than 32,768 X 15 in size.

Any help will be appreciated.

Best regards.

I have two tables of information. The first is a matrix with some distances. The second is a table of distribution. Ive been trying this for a long time now with limited success using a truth table but i've realised the only way to do this is in code. Ive got limited experience with this so please point me in the right direction.

Ive written some steps explaining what each table does here -

Step 1 Check for lowest value B4:F4 in Table 1 (in example is 10)

Step 2 Check corresponding column destination available capacity in table 2 (Example 500)

Step 3 Distribute as much as possible from source in table 2 (500)

Step 4 Reduce value in capacity line by value taken from source

Step 5 If some source remains move back to table 1 and find next nearest column Dest

Step 6 Repeat step 2 until all source is gone in row

Step 7 Check for lowest value B5:F5 in Table 1

if run out of capacity at all sites stop code

etc

until Table 1 column B is empty

Ive posted a spreadsheet with some before and after tables in it aswell. Its very small and formatted o its easy to see whats happening.

Thanks for taking a look.

Looking for some help on the VBA side of things in simple English

What I have is 2 worksheets.

Worksheet1: Has the RAG status (Red, Amber, Yellow, Blue, Gray)

Worksheet2: Has 2 different combo boxes for Schedule and Cost

What I Have is: in Worksheet2 with the Combo box I can select the color of the status and it will update the same color in Sheet1 of RAG status.

What I would like to Have: The RAG status in Sheet one is changed depending on AND/OR logical operation of the 2 combo boxes.

FOR EXAMPLE: Combo box 1 = Red, ComboBOx 2 = Amber, then I want to the change the status to Red

Truth Table:

Any combo box is Red: RAG is RED

Any combo box is Amber AND not Red: RAG is Amber

Any combo Box is Yellow and not Amber OR Red : RAG is Yellow

Any combo Box is Green and the other NOT red, amber or yellow: RAG is Green

If both combo box is blue: RAG Blue

If any combo box is gray then the other combo box color should be used.

Please see the attached excel and would appreciate the help

Thanks

I just registered here, and did a search for XOR and XNOR, but didn't get any results. What I'm trying to do is find the XNOR result for a range (Ax:Ay) of cells in a column that have binary (0,1) data.

I know I can do "=NOT(OR(AND(A1,NOT(A2)),AND(NOT(A1),A2)))" for 2 rows at a time, and then XNOR those results 2 rows at a time, until I get a final result. I'd rather have a function that I can pass the 2 endpoints of the range to, and have it return the final result.

XNOR Truth Table

A B A XNOR B

0 0 ........ 1

0 1 ........ 0

1 0 ........ 0

1 1 ........ 1

........... XNOR (RESULT)

A1 = 1

A2 = 1 .... 1

A3 = 0 .... 0

A4 = 1 .... 0

A5 = 0 .... 1

A6 = 0 .... 0

A7 = 0 .... 1

A8 = 1 .... 1

I don't know VBA, but I can program in AWK, Perl, and various shell scripts. Here's a description of what I'd do in those languages:

First, set RESULT equal to Cell A1.

Then, iterate through the rest of the cells with the XNOR calculation.

RESULT = Ax

for( CELL2 = Ax+1 ; CELL2

i would like to do a logic if then statement for a logic truth table...

???

thank you.

If anyone can help me please do so, an example will be A GREAT HELP, but if there is another way to do this please tell me. Thank you for your time and effort.

In a game show it is necessary for a team of 4 people to vote for a particular choice without any negotiation. Each memeber of the team has a pair of buttons labelled 'yes' and 'no'one of which they must press to vote for their choice. All members of the team must vote. The votes are then collated and the overall team choice is given by the following rules:

-a majority vote of YES implies a team vote of YES;

- a majority vote of NO implies a team vote of NO;

-A split decision implies a team vote of YES.

Required:

a)Draw up a truth table showing the possible voting patterns of team members and the resulting decisions. From the table, derive a Boolean expression which will give the correct team vote, given the individual votes.

b) Using a Karnaugh Map, simplify this expression and give the simplest switching circuit to implement this.

c) How would the circuit change if there were 5 players, 6 players,...n players? Generalise your result from part b).

d) In the original game, all members of the team had to vote. The designers of the game think it would be better if members of the team were allowed not to vote if they so wished. Take a paragraph or two to discuss the way in which the logic of the new situation differs from the previous situation and to consider how you might implement a possible circuit.

I recently constructed a large spreadsheet for a

colleague which, amongst other things samples at

intervals the number of staff available (that is not on a

break, not on leave , not sick etc.) based on a staff

roster.

For example at 10:15, 10:30, etc how many staff are

available to take calls during that interval.

A very simplified version of the problem is as follows:

Row 2

Column A = a list of names

Column B = each member of staffs shift start time i.e.

08:00

Column C = each member of staffs shift end time i.e. 16:00

Row 1, starting at Column D is filled with each interval

i.e. 08:00, 08;15, 08:30, 08:45..up to, for example,

20:00.

The following formula is entered into each cell starting

at row 2, column D up to the final interval, in this case

20:00, for each name - constructing a kind of truth table.

=IF(AND(D$1>=$B2,D$1

I'm a student taking philosophical thinking, which includes using truth

tables of the functions AND, OR, IF, NOT.

It isn't part of he course, but I've been playing around with excel

logical functions, and have all working except the 'material condition'

if. Rather, I have got it working, but only by doing a 2 stage

calculation along the lines of:

1 =IF(B11=C11,TRUE)

2 =OR(C11,D11)

Can anyone tell me; a) is there a simpler way to do this, and/or b) how

does one go about nesting these so that it can be done in one go?

I'd be very grateful for any steers at all,

Mike (UK)

--

mikebispham

------------------------------------------------------------------------

mikebispham's Profile: http://www.excelforum.com/member.php...o&userid=31180

View this thread: http://www.excelforum.com/showthread...hreadid=508424

page via a Web Query, that is invoked from a macro. The web pages

concerned have small GIF images about the size of the text font

floating near some of the text (as a substitute for an asterisk, it

seems). These symbols appear to corrupt the data which the Web Query

fetches- a variable amount of following data is lost.

How can I avoid this? It seems, for instance, that there might be a VB

command which will cause these GIF images to be ignored. Typical macro

script that invokes the query is:

Sheets("ALBE").Select

Range("A26").Select

With ActiveSheet.QueryTables.Add(Connection:= _

"FINDER;C:QLDVTRQueriesTESTIQYTESTALBE.IQY ", _

Destination:=Range("A26"))

.Name = "ALBE"

.FieldNames = True

.RowNumbers = False

.FillAdjacentFormulas = False

.PreserveFormatting = False

.RefreshOnFileOpen = False

.BackgroundQuery = True

.RefreshStyle = xlOverwriteCells

.SavePassword = False

.SaveData = True

.AdjustColumnWidth = False

.RefreshPeriod = 0

.WebSelectionType = xlAllTables

.WebFormatting = xlWebFormattingAll

.WebPreFormattedTextToColumns = False

.WebConsecutiveDelimitersAsOne = True

.WebSingleBlockTextImport = False

.WebDisableDateRecognition = False

.Refresh BackgroundQuery:=False

End With

Where the IQY file contains the web address

Is there something in the truth table which can be altered, or is

there something I can add to achieve what I want.

This problem occurs with Excel2003 and Excel2002

Thanks

Geoff Lambert

Ive got a hard problem to solve. The matrix attached has input capacities across the top and source production figures down the left. Moving from left to right across the matrices the spreadsheet first contains the distances between sources and destinations. Second it analyses the efficiency, thirdly it uses a table to lookup actual values already stored and finally it has a truth table to relate to when calculating availability and capacity.

The idea is to minimise the milage. The version in the attachment I had assistance from SHG developing a while ago and it is very good but it doesn't take into consideration one key factor.

If destination capacity of the nearest site has for example 20000 and the source has 20001 the spreadsheet moves on to the next available destination. This is not optimal because its best to utilise the 20000 and forward the 1 to the next nearest site!

Thanks for your help in advance.

couple days increase the number of bits. Many VB examples so it should not

take more than a couple days. I have other tools but I love excel many

thanks. Plus I am sure that I could use that extra rows for creating memory

maps. Please, pretty please it would realy save some time. I am not looking

for matlab or building C program its nice to have excel

Can you fix them all

=DEC2HEX(-1, 10)

=DEC2OCT(-1,10)

=Hex2bin(Fx,10)

=Hex2dec(fx,10)

=BIN2DEC(1000000000)

Floating point would be cool single precision and double precision ascii

=DEC2FLOAT key ones DEC2FLOAT

=DEC2DFLOAT

=HEX2FLOAT

=HEX2DFLOAT

=BIN2FLOAT

=BIN2DFLOAT

=OCT2FLOAT

=OCT2DFLOAT

=FLOAT2BIN(1x,x) rounded

=DFLOAT2BIN(x,x) rounded

=FLOAT2HEX(1, x) rounded

=â€¦..

Maybe you could even add truth table logic like processor xor nor nand rol â€¦.

--

Think Deep

----------------

This post is a suggestion for Microsoft, and Microsoft responds to the

suggestions with the most votes. To vote for this suggestion, click the "I

Agree" button in the message pane. If you do not see the button, follow this

link to open the suggestion in the Microsoft Web-based Newsreader and then

click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...lic.excel.misc

I'm a student taking philosophical thinking, which includes using truth tables of the functions AND, OR, IF, NOT.

It isn't part of he course, but I've been playing around with excel logical functions, and have all working except the 'material condition' if. Rather, I have got it working, but only by doing a 2 stage calculation along the lines of:

1 =IF(B11=C11,TRUE)

2 =OR(C11,D11)

Can anyone tell me; a) is there a simpler way to do this, and/or b) how does one go about nesting these so that it can be done in one go?

I'd be very grateful for any steers at all,

Mike (UK)

The problem I have run into is the result is fine until you start using the NOT operator in the equation.

The next line is the equation out of the code according to the equation any "0" input in the third column should return a result of "1" in the fourth column

= (INPUTval(0) And (Not (INPUTval(1)) Or (Not (INPUTval(2)))))

0 0 0 0

1 0 0 1

0 1 0 0

1 1 0 1

0 0 1 0

1 0 1 1

0 1 1 0

1 1 1 0

When "Not" is used I either get a negative number as a result, or a a wrong result when the equation seems to be written correctly. The code is below. It is a combination of examples off the web and my own doings. any help will be greatly appreciated...

Thanks in advance, Blues

This will be pasted in the Work sheet in the top rows (In Bold)

IN_0 IN_1 IN_2

Min 0 0 0

Max 1 1

Option Explicit Sub MakeBinGri() Dim intCols As Integer Dim intRows As Integer Dim intRowPtr As Integer Dim intColPtr As Integer Dim strText As String Dim INPUTval(20) As Integer Dim MinMax(20, 2) As Integer '''''''''''' Min will be MinMax(X, 1) ''''''''' Max will be MinMax(X, 2) Const intOffset As Integer = 5 intCols = val(InputBox("Enter number of columns", "Cols?")) intRows = (2 ^ intCols) - 1 ' zero based intCols = intCols - 1 ' zero based ''''''''''''' Collect the Min Max Values ''''''''''''''''''''''''' For intColPtr = 0 To intCols MinMax(intColPtr, 1) = Cells(2, intColPtr + 2) MinMax(intColPtr, 2) = Cells(3, intColPtr + 2) Next intColPtr ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' If intCols = 0 Then Exit Sub End If ''''''''''''' Loop For Truth Table building ''''''''''''''''''''''' For intRowPtr = 0 To intRows For intColPtr = 0 To intCols If (intRowPtr And (2 ^ intColPtr)) > 0 Then strText = MinMax(intColPtr, 2) Else strText = MinMax(intColPtr, 1) End If INPUTval(intColPtr) = strText Cells(intRowPtr + intOffset + 1, intColPtr + intOffset - 3) = strText Next intColPtr ''''''''''''''''''''' Equation '''''''''''''''''''''''''''''''''''''''''''''' Cells(intRowPtr + intOffset + 1, intCols + intOffset) = (INPUTval(0) And (Not (INPUTval(1)) Or (Not (INPUTval(2))))) ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Next intRowPtr ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Cells(intOffset, intCols + intOffset) = "Exp Results" End Sub

I recently constructed a large spreadsheet for a

colleague which, amongst other things samples at

intervals the number of staff available (that is not on a

break, not on leave , not sick etc.) based on a staff

roster.

For example at 10:15, 10:30, etc how many staff are

available to take calls during that interval.

A very simplified version of the problem is as follows:

Row 2

Column A = a list of names

Column B = each member of staffs shift start time i.e.

08:00

Column C = each member of staffs shift end time i.e. 16:00

Row 1, starting at Column D is filled with each interval

i.e. 08:00, 08;15, 08:30, 08:45..up to, for example,

20:00.

The following formula is entered into each cell starting

at row 2, column D up to the final interval, in this case

20:00, for each name - constructing a kind of truth table.

=IF(AND(D$1>=$B2,D$1<$C2),"IN","NOT IN")

Seems straightforward enough, I hope. This works as

expected - but only up to a point! If you constuct this

table and enter the following data you may encounter an

unexpected problem.

For the 1st staff member Column A row 2 give a start time

of 08:00 and an end time of 14:45. This should show

correct. The staff member is showing as "NOT IN" at the

14:45 interval. Now increase the end time for the same

staff member by 00:15 intervals. At 15:00 the table

still reads correctly - "NOT IN" at 15;00. At 15:15

however... If you have the inclination continue this and

each time see what the table shows.

Apologies for being so verbose.

Does anyone have an explanation? Is this a known

problem? Any solutions?

Thanks in advance. Ian

I am trying to wet up excel to not only select what ttl gate I am using but from that selection produce the correct truth table. for example:

if i input a 0 in cell A3 and a 1 in cell B3 it display the gate type AND in cell F3. there are 4 basic ttl gates 0,0=OR, 0,1=AND, 1,0=NAND, and 1,1=NOR. for each input in A3 and B3 it should select the gate that matches those inputs.

I also want this to show the truth table for the gate selected. I will continue with the example above. the AND gate. Inputs will be entered in cells C3 and D3 and the output will be display in E3.

input C3 input D3 Output E3

0 0 0

0 1 0

1 0 0

1 1 1

The truth tables are different for each gate. but if an AND gate is selected the output should display as above and so on and so on for the 4 gates.

thanks in advance for any help or suggestions...

Any ideas?

See the attached example. Instead of B13 showing the actual static formula (made possible because cell B! is formatted as TEXT), I would like the VLOOKUP function in B13 to show the actual formula' execution and return a value of 7. Is this possible?

By the way, the original formula that I hit a wall with is pasted below in this Post.

Thanks,

Dan

=IF(AND(NOT(Y11),NOT(Z11),NOT(AA11),NOT(AB11)),G11*$AE$2,IF(AND(NOT(Y11),Z11,NOT(AA11),NOT(AB11)),G1 1*$AE$4,IF(AND(NOT(Z11),AA11),G11,IF(AND(Z11,AA11),G11*(1-($AE$3/$AE$1)),IF(AND(NOT(Z11),AB11),G11*X11,IF(AND(NOT(Y11),Z11,AB11),G11*X11*(1-$AE$3/$AE$1),IF(AND(Y11,Z11,AB11),G11*X11*($AE$6/$AE$2),G11*$AE$5)))))))

I am in need of your help again. Please see attached sheet of which I believe can explain what I am looking for. Based upon the truth table (I trust I listed all of the possibilities), I require a formula that will provide word result in a cell along with changing the cell color as noted. I started a long "IF" formula only for it to crash after a short length (partial example also in the attached worksheet). I am currently using Excel 2007.

Thanks!

J. Morrow

another from a single worksheet. Right now the workbook is 50 MB, any

tips out there to minimize the size (other than having the pivot tables

tie together).

thanks

--

shadestreet

------------------------------------------------------------------------

shadestreet's Profile: http://www.excelforum.com/member.php...fo&userid=7092

View this thread: http://www.excelforum.com/showthread...hreadid=534324

I have a Pivot Table that looks something like this:

#------Name------Product

1------Alpha-------

-----------------------A

-----------------------B

-----------------------C

2------Beta-----------

-----------------------B

-----------------------D

------------------------E

Now, I can loop through any one item and change the ShowDetail to minimize it. The problem is that what I want is to change the ShowDetail to False for the Pivot Field called 'Name', but as my criteria, I need to look at the # field.

thanks

1 Pivot table based on multiple ranges (same Format) over a number of spreadsheets

Initially I thought that this would be possible using consolidate pivot tables, however this tends to consolidate only the value / amount fields and even when the pivots reworked will not give a standard pivot table. If you then drill down data (doubler click on total) the data is not in the same format as source.

I would welcome any ideas i.e. name ranges covering multiple sheets, re working of consolidated pivot table drill down data or even a simple macro to copy and paste data forma each of multiple source sheets onto one consolidated sheet.

I have even considered putting the individual sheets into Access to produce the pivot table.

Once again I find it hard to believe that this problem has not arisen before and a solution found. I certainly believe that this is the sort of solution to a Pivot table challenge that a number of people would find extremely useful.

2. Update links to external spreadsheets automatically without confirmation ( Click OK to update links)

The source data for this proposed Pivot table is based on a number of templates pulling data linked to data files downloaded from a mainframe report ( Peoplesoft –Excel query export ).

Is there a VBA command / Macro to upload and update all data and template spreadsheets with minimal or no further interaction on my part?

Many thanks in advance for your help with these queries

No luck finding an answer? You could always try Google.