Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Functional Programming in Excel with LET and LA...

Functional Programming in Excel with LET and LAMBDA Function

Quadri Atharu Olayinka

September 21, 2023
Tweet

Other Decks in Programming

Transcript

  1. INTRODUCTION TO FUNCTIONAL PROGRAMMING Functional programming is a programming paradigm

    that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data. It is a declarative type of programming that focuses on “what to solve” rather that “how to solve”
  2. LAMBDA CALCULUS (ʎ-CALCULUS)  Lambda calculus is a foundation for

    functional programming languages, as it provides a simple and powerful way to express computations. It is also used in the study of computability and formal logic.  It is a mathematical model of computation based on the concept of functions and variables. Lambda calculus uses lambda expressions to represent functions and their arguments.  It was developed by mathematician Alonzo Church in the 1930s before advent of electronic computers.  It has been a feature of numerous programming languages since Lisp in 1958.
  3. LAMBDA FUNCTION The LAMBDA function enables you to create custom

    reusable functions in Excel. It allows you to encapsulate complex logic, making your spreadsheets more modular and easier to maintain. It takes in a list of parameters and a lambda expression that defines how the function behaves. Here's an example: =LAMBDA(parameter_or_calculation,parameter_or_calculation..) =LAMBDA(x, y, x^2 + y^2)
  4. The LET function in Excel allows you to define variables

    within a formula. It enhances formula readability and performance by breaking down complex calculations into smaller, more manageable steps.
  5. Modularity: FP promotes modularity by breaking down programs into smaller,

    reusable functions. This makes it easier to understand, test, and maintain code. Immutability: In functional programming, variables are immutable, meaning it cannot be changed once created. This eliminates the risk of unexpected side effects and makes programs more reliable and easier to reason about. Lazy Evaluation: It avoids repeated evaluation as value is evaluated and stored only when it’s needed.