With Ms Excel Full Work — Build Neural Network

Building a Neural Network with MS Excel: The Complete Guide

Step 3.2: The Hidden Layer Activation (A_hidden)

Sigmoid function: $\frac11+e^-z$

  • Cell G2: =1/(1+EXP(-B2)) (Targets H1 Z value)
  • Cell H2: =1/(1+EXP(-C2))
  • Cell I2: =1/(1+EXP(-D2))
  • Cell J2: =1/(1+EXP(-E2))
  • Drag rows G2:J2 down to row 5.

Step 8: Training Loop (The Manual Step)

Because Excel doesn't have a native loop without VBA, you have two options:

Option A: Copy-Paste Iteration (Simple for learning)

  1. Copy the "Updated Weights" cells.
  2. Select your original "Initial Weights" cells.
  3. Right-click -> Paste Special -> Values.
  4. Watch the Total Loss (Cell B5) decrease.
  5. Repeat 500 times (or until loss < 0.005).

Option B: Circular References (Advanced/Automatic) build neural network with ms excel full

  1. Go to File -> Options -> Formulas -> Enable Iterative Calculations (Max Iterations: 5000).
  2. In the "Initial Weights" cell, write: =IF(ISBLANK(Control_Cell), RAND(), New_Weight_Cell).
  3. Toggle the Control_Cell to trigger training. (Complex but powerful).

Matrix Multiplication without crashing Excel

Instead of repeating formulas, use offset ranges. However, Excel struggles with 10,000 manual loops. Instead, we use a Training Log:

  • Sheet "Log": Column A = Iteration #, Column B = Total Loss.
  • Macro (Alt + F11): Write a simple VBA loop:
Sub TrainNetwork()
    Dim i As Integer
    For i = 1 To 5000
        'Refresh Formulas
        Calculate
        'Record Loss from Forward_Prop!$P$6 into Log sheet
        Sheets("Log").Cells(i, 1) = i
        Sheets("Log").Cells(i, 2) = Sheets("Forward_Prop").Range("P6").Value
        'Copy Update values back to Parameters
        Sheets("Parameters").Range("B2:C5").Value = Sheets("Update").Range("B2:C5").Value
        Sheets("Parameters").Range("E2:E5").Value = Sheets("Update").Range("E2:E5").Value
        Sheets("Parameters").Range("G2:J2").Value = Sheets("Update").Range("G2:J2").Value
        Sheets("Parameters").Range("L2").Value = Sheets("Update").Range("L2").Value
    Next i
End Sub

Option 2: Twitter / X (Short, punchy, shareable)

🧠 You don’t need Python to build a Neural Network.

You can build one in Microsoft Excel.

Forward prop ✅
Backprop ✅
Gradient descent ✅

Excel forces you to understand the math behind deep learning. No hidden layers (pun intended).

Want the full tutorial + free template?
Like & RT, and I’ll DM the link. 👇 Building a Neural Network with MS Excel: The

#Excel #NeuralNetwork #DataScience


Create the Parameter Tables

1. Input to Hidden Weights (W1)

  • Range: B4:E5
  • Label rows as x1, x2. Label columns as h1, h2, h3, h4.
  • Fill with random values between -0.5 and 0.5 (e.g., =RAND()-0.5)

2. Hidden Bias (b1)

  • Range: G4:G7 (4 rows, 1 column)
  • Label bias_h1...bias_h4. Initial values: 0.1

3. Hidden to Output Weights (W2)

  • Range: J4:J7
  • Label rows h1...h4, column output. Random values between -0.5 and 0.5.

4. Output Bias (b2)

  • Cell J10: 0.1

نموذج الاتصال