We will calculate the Hidden Layer and Output Layer using formulas.
A. Hidden Layer Calculations: For each hidden neuron, calculate the Sigmoid of the weighted sum.
B. Output Layer Calculations: Take the results from the Hidden Layer, multiply by the Output Weights, add the Output Bias, and Sigmoid again.
In the modern era of artificial intelligence, it seems like you need a PhD in mathematics, a powerful GPU cluster, and fluency in Python (TensorFlow or PyTorch) to build a neural network. However, a quiet revolution has occurred. You can now build a fully functional, learning neural network using the "new" dynamic array features of Microsoft Excel. build neural network with ms excel new
Forget the old days of clunky VBA macros or manual matrix multiplication. With Excel’s dynamic arrays (FILTER, SORT, RANDARRAY) and modern LAMBDA functions, you can build a Forward Propagation and Backpropagation engine from scratch inside a spreadsheet.
In this guide, we will build a 3-layer perceptron (Input → Hidden → Output) capable of learning the XOR logic gate—a classic problem that proves non-linear learning. By the end, you will have a living Excel model that "learns" in front of your eyes.
After training, a user could see the forward pass using only native functions (no magic): We will calculate the Hidden Layer and Output
// Forward pass of a single layer in a cell
= MAP(neuron_weights, LAMBDA(w, SIGMOID(SUMPRODUCT(w, prev_activations) + bias)))
We need to calculate: Output = Sigmoid( (ReLU( Input·W1 + B1 )) · W2 + B2 )
Before you close the tab, understand this: Excel is the most widely used programming environment on earth. It is a massively parallel grid of 17 billion cells. When you strip away the abstraction of torch.nn.Linear, building a network in Excel forces you to confront the raw mechanics of matrix multiplication and the chain rule.
If you can implement backprop in Excel, you don't understand neural networks—you feel them. After training, a user could see the forward
These would work like =SUM() or =LINEST().
| Function | Description | Example |
| :--- | :--- | :--- |
| =NEURAL.NETWORK(...) | Creates a network object reference. | =NEURAL.NETWORK(layers, activations) |
| =NEURAL.TRAIN(network, inputs, targets, [epochs], [lr]) | Trains and returns trained network. | =NEURAL.TRAIN(A1, B2:D100, E2:E100, 500, 0.01) |
| =NEURAL.PREDICT(network, new_inputs) | Forward pass prediction. | =NEURAL.PREDICT(F1, G2:G5) |
| =NEURAL.LOSS(network, inputs, targets) | Returns current loss. | =NEURAL.LOSS(F1, B2:D100, E2:E100) |
| =NEURAL.WEIGHTS(network, layer_from, layer_to) | Returns weight matrix as a dynamic array. | =NEURAL.WEIGHTS(F1, 2, 3) |