Build Neural Network With Ms Excel New | TRUSTED ✦ |

Excel cannot auto-differentiate, so we manually optimize using trial & error (or Excel Solver later).

This is where the magic happens. Standard Excel doesn't "learn" automatically; we must calculate the gradients (how much to change the weights) using formulas.

We will calculate the Hidden Layer and Output Layer using formulas. build neural network with ms excel new

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. We will calculate the Hidden Layer and Output

In cell H6: =MMULT(F8#, W2) + B2

delta_hidden = MMULT(delta_output, TRANSPOSE(W2)) * HiddenActivation * (1 - HiddenActivation)

Create a new workbook and name the sheet "NN_XOR". multiply by the Output Weights

Set up these named ranges (use Formulas → Name Manager):

| Name | Refers to | Purpose | |---------------|---------------------------|--------------------------| | InputData | =Sheet1!$B$3:$C$6 | 4x2 matrix of inputs | | TargetData | =Sheet1!$D$3:$D$6 | 4x1 matrix of targets | | W1 | =Sheet1!$F$3:$G$4 | 2x2 weights (input→hidden) | | b1 | =Sheet1!$I$3:$I$4 | 2x1 biases (hidden) | | W2 | =Sheet1!$K$3:$K$4 | 2x1 weights (hidden→output) | | b2 | =Sheet1!$M$3 | 1x1 bias (output) |