After several hundred manual iterations (or using a macro to loop), the network will converge:
| Input (X1,X2) | Target (XOR) | Excel Output (Prediction) | | :--- | :--- | :--- | | 0,0 | 0 | ~0.02 | | 0,1 | 1 | ~0.98 | | 1,0 | 1 | ~0.98 | | 1,1 | 0 | ~0.03 |
The Mean Squared Error will drop from ~0.25 to <0.005.
Enter the XOR truth table:
| A | B | C | | :--- | :--- | :--- | | X1 | X2 | Y (Target) | | 0 | 0 | 0 | | 0 | 1 | 1 | | 1 | 0 | 1 | | 1 | 1 | 0 |
This is the core "feature" of the build. You are not writing Python scripts; you are writing Excel formulas.
MMULT):
(Delta_Output * W12_O) * H2_Act * (1 - H2_Act)
Copy rows L20:W20 down for rows 21, 22, 23. build neural network with ms excel full
You don’t need Python, TensorFlow, or expensive hardware to understand how deep learning works. In fact, you can build a fully functional neural network using only Microsoft Excel. This exercise is one of the most powerful ways to demystify the mathematics behind AI—forward propagation, backpropagation, and gradient descent—because you can see every calculation, every weight update, and every error change in real-time.
In this article, we will build a 3-layer neural network (input, hidden, output) to solve a simple problem: learning the XOR logic gate. XOR is a classic non-linear problem that a single perceptron cannot solve, making it the perfect test for a multi-layer network.
Arthur opened a blank workbook. He wasn't just typing numbers; he was architecting a digital brain. After several hundred manual iterations (or using a
He started with the Inputs. He needed a problem simple enough to prove the concept but complex enough to require a brain. He chose the classic "XOR problem"—a logic gate where the output is true only if the inputs are different (0 and 1, or 1 and 0). A simple linear model couldn't solve this; it required a hidden layer. It required "deep" learning.
He designated Columns A and B as his Input Neurons.
Next came the Hidden Layer, the brain within the brain. Arthur decided on two hidden neurons. This meant Weights. Weights are the dials the network turns to learn. Matrix Multiplication ( MMULT ):
He created a section to the right, labeling cells F2 and G2 as "Weights Layer 1." He initialized them with random numbers using the formula =RAND().
Then, he needed a Bias—a threshold for firing. He allocated cells F4 and G4.