Book Image

Data Analysis and Business Modeling with Excel 2013

Book Image

Data Analysis and Business Modeling with Excel 2013

Overview of this book

Table of Contents (18 chapters)
Data Analysis and Business Modeling with Excel 2013
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
10
Creating Interactive Spreadsheets Using Tables and Slicers
Index

If/else/then statements


Conditional statements is our next topic at hand. This functionality will give you, the Excel developer, more control, power, and freedom. You will now be able to add intelligence to your spreadsheets and the following examples will tell you how to do this:

  1. Fire up Excel 2013 and create a new spreadsheet. Manually enter the following information:

    Column B tells us how much inventory we currently have on hand. In column C, we will determine whether we need to buy more inventory. Column D will tell us whether we have to buy more inventory and how much inventory we have to buy. We are going to make the assumption that we cannot have more than 200 items in our inventory. In other words, we cannot have more than 200 apples, 200 grapes, and so on.

    How are we going to determine whether we are low in inventory? We are going to use Excel's conditional statements.

  2. In cell C2, type =if(B2<200,"yes","no"), as shown in the following screenshot. How does the if function work? The...