# DeMorgan Theorem & Excel Formula

1. Aug 14, 2006

### Newtonian_gravity21

=IF (C1>1,"yes","No") I think thats right :uhh:

Does Demorgan Theorem use a simular logic when doing calculations for logic gates, using true and false properities?

2. Aug 29, 2006

### mtanti

Demorgan Theorem states that you can change the AND to OR and vise versa by using NOTs. Such as:
A AND B = NOT (NOT A OR NOT B)
A OR B = NOT (NOT A AND NOT B)

Where does this come from? I see it when using loops in programming. A WHILE loop needs a condition to continue looping whilst a REPEAT loop needs a condition to stop looping. They use opposite logic. Now the problem comes when you want to use a different loop which has a compound condition.

EG WHILE (end of file not reached) and (user did not press esc) read file

Now which is the equivalent expression to make a REPEAT loop?

REPEAT read file UNTIL (end of file reached) OR (user pressed esc)

See? We used DeMorgans except that we did not use the outer NOT because other wise it would have returned the same result as with the first loop. Simple huh?