Examples and Tutorials

Step-by-step tutorials and practical examples for machine learning in Excel with FormulaML. Learn through complete, real-world workflows.

Examples and Tutorials

Learn FormulaML through practical, step-by-step examples. Each tutorial provides a complete workflow you can follow in Excel.

Tutorial Categories

🎯 Beginner Tutorials

Perfect for getting started with machine learning in Excel.

Linear Regression: Sales Forecasting

Learn regression basics by predicting sales based on various factors.

  • Dataset: Diabetes (adapted for sales context)
  • Skills: Data loading, model training, evaluation
  • Time: 15 minutes

Classification: Iris Flowers

Classic machine learning example for categorization.

  • Dataset: Iris
  • Skills: Multi-class classification, model comparison
  • Time: 20 minutes

📊 Intermediate Examples

Customer Segmentation with Clustering

Group customers for targeted marketing campaigns.

  • Dataset: Custom business data
  • Skills: K-Means clustering, interpretation
  • Time: 25 minutes

Model Comparison Workflow

Compare multiple algorithms on the same problem.

  • Skills: Systematic evaluation, selection criteria
  • Time: 30 minutes

🚀 Advanced Workflows

Building ML Pipelines

Combine preprocessing, training, and evaluation in one workflow.

  • Skills: Pipelines, automation, advanced preprocessing
  • Time: 35 minutes

Hyperparameter Tuning

Optimize model performance with grid search.

  • Skills: Grid search, cross-validation
  • Premium Required
  • Time: 40 minutes

Quick Start Examples

Example 1: Your First Prediction

# Load data
Cell A1: =ML.DATASETS.IRIS()

# Create and train model
Cell B1: =ML.CLASSIFICATION.SVM()
Cell B2: =ML.FIT(B1, features, target)

# Make prediction
Cell C1: =ML.PREDICT(B2, new_data)

Example 2: Simple Regression

# Load regression dataset
Cell A1: =ML.DATASETS.DIABETES()

# Separate features and target
Cell B1: =ML.DATA.SELECT_COLUMNS(A1, "0:9")
Cell C1: =ML.DATA.SELECT_COLUMNS(A1, 10)

# Train linear regression
Cell D1: =ML.REGRESSION.LINEAR()
Cell D2: =ML.FIT(D1, B1, C1)

# Check performance
Cell E1: =ML.EVAL.SCORE(D2, B1, C1)

Example 3: Data Exploration

# Convert Excel data
Cell A1: =ML.DATA.CONVERT_TO_DF(MyData!A:E, TRUE)

# Explore
Cell B1: =ML.DATA.INFO(A1)
Cell B2: =ML.DATA.DESCRIBE(A1)
Cell B3: =ML.DATA.SAMPLE(A1, 10)

Learning Paths

Path 1: Business Analyst

  1. Start with Linear Regression Tutorial
  2. Move to Customer Segmentation
  3. Learn Model Comparison
  4. Apply to your own data

Path 2: Data Explorer

  1. Begin with Data Exploration
  2. Try Classification Tutorial
  3. Explore Different Models
  4. Practice Evaluation Techniques

Path 3: Advanced User

  1. Master Pipelines
  2. Optimize with Hyperparameter Tuning
  3. Explore Advanced Features
  4. Build complex workflows

Example Templates

Regression Template

=ML.DATASETS.DIABETES()                          # A1: Load data
=ML.DATA.SELECT_COLUMNS(A1, "0:9")              # B1: Features
=ML.DATA.SELECT_COLUMNS(A1, 10)                 # C1: Target
=ML.PREPROCESSING.TRAIN_TEST_SPLIT(B1,C1,0.2,42) # D1: Split
=ML.REGRESSION.LINEAR()                          # E1: Model
=ML.FIT(E1, INDEX(D1,1), INDEX(D1,3))           # F1: Train
=ML.EVAL.SCORE(F1, INDEX(D1,2), INDEX(D1,4))   # G1: Evaluate

Classification Template

=ML.DATASETS.IRIS()                              # A1: Load data
=ML.DATA.SELECT_COLUMNS(A1, {0,1,2,3})          # B1: Features
=ML.DATA.SELECT_COLUMNS(A1, 4)                  # C1: Target
=ML.PREPROCESSING.TRAIN_TEST_SPLIT(B1,C1,0.2,42) # D1: Split
=ML.CLASSIFICATION.SVM()                         # E1: Model
=ML.FIT(E1, INDEX(D1,1), INDEX(D1,3))           # F1: Train
=ML.EVAL.SCORE(F1, INDEX(D1,2), INDEX(D1,4))   # G1: Evaluate

Clustering Template

=ML.DATA.CONVERT_TO_DF(Data!A:D, TRUE)          # A1: Load data
=ML.CLUSTERING.KMEANS(4)                        # B1: Model
=ML.FIT(B1, A1)                                 # C1: Train
=ML.PREDICT(C1, A1)                             # D1: Clusters
=ML.DATA.SAMPLE(D1, -1)                         # E1: View all

Common Workflows

Workflow 1: Complete ML Pipeline

  1. Data Loading → Convert or load dataset
  2. Exploration → INFO, DESCRIBE, SAMPLE
  3. Preparation → Select columns, handle missing
  4. Splitting → Train/test split
  5. Model Creation → Choose algorithm
  6. Training → FIT with training data
  7. Prediction → PREDICT on test data
  8. Evaluation → SCORE for performance

Workflow 2: Model Selection

  1. Prepare Data → Same for all models
  2. Create Models → Multiple algorithms
  3. Train Each → Same training data
  4. Evaluate All → Same test data
  5. Compare Scores → Pick best performer
  6. Validate Choice → Cross-validation if premium

Workflow 3: Production Pipeline

  1. Historical Data → Your Excel data
  2. Create Pipeline → Preprocessing + Model
  3. Train Pipeline → On all historical data
  4. Save Model → Keep trained object
  5. New Data → Fresh Excel data
  6. Predict → Apply to new data
  7. Monitor → Track performance

Tips for Following Examples

Setting Up

  1. Create new worksheet for each example
  2. Label your cells clearly (e.g., “Training Data”)
  3. Use consistent cell references (A1 for data, B1 for models)
  4. Save frequently to preserve object handles

Best Practices

  • Read entire tutorial first before starting
  • Type formulas manually (don’t copy-paste) for learning
  • Check intermediate results with SAMPLE
  • Note the object handles returned
  • Document your work with cell comments

Troubleshooting Examples

  • #NAME? error: FormulaML not installed
  • Object handle not found: Reference correct cell
  • Dimension mismatch: Check data shapes match
  • Premium required: Use free alternative or upgrade

Real-World Applications

Sales & Marketing

  • Customer lifetime value prediction
  • Churn prediction and prevention
  • Market segmentation
  • Sales forecasting
  • Lead scoring

Finance

  • Credit risk assessment
  • Fraud detection
  • Portfolio optimization
  • Price prediction
  • Demand forecasting

Operations

  • Quality control
  • Inventory optimization
  • Maintenance prediction
  • Resource allocation
  • Process optimization

Human Resources

  • Employee retention
  • Performance prediction
  • Recruitment screening
  • Training needs analysis
  • Compensation analysis

Contributing Examples

Have a great FormulaML example? We’d love to include it!

  • Real-world business problems
  • Creative uses of ML in Excel
  • Industry-specific applications
  • Novel workflows

Contact: examples@formulaml.com

Next Steps

Ready to start learning?

  1. Beginners: Start with Linear Regression Tutorial
  2. Intermediate: Try Customer Segmentation
  3. Advanced: Explore Pipeline Tutorial
  4. Apply: Use templates with your own data

Or browse:

Let’s build something amazing with machine learning in Excel!