Skip to ContentGo to accessibility pageKeyboard shortcuts menu
OpenStax Logo
Workplace Software and Skills

10.2 More About Formulas

Workplace Software and Skills10.2 More About Formulas

Table of contents
  1. Preface
  2. 1 Technology in Everyday Life and Business
    1. Chapter Scenario
    2. 1.1 Computing from Inception to Today
    3. 1.2 Computer Hardware and Networks
    4. 1.3 The Internet, Cloud Computing, and the Internet of Things
    5. 1.4 Safety, Security, Privacy, and the Ethical Use of Technology
    6. Chapter Review
      1. Key Terms
      2. Summary
      3. Review Questions
      4. Practice Exercises
      5. Written Questions
      6. Case Exercises
  3. 2 Essentials of Software Applications for Business
    1. Chapter Scenario
    2. 2.1 Software Basics
    3. 2.2 Files and Folders
    4. 2.3 Communication and Calendar Applications
    5. 2.4 Essentials of Microsoft 365
    6. 2.5 Essentials of Google Workspace
    7. 2.6 Collaboration
    8. Chapter Review
      1. Key Terms
      2. Summary
      3. Review Questions
      4. Practice Exercises
      5. Written Questions
      6. Case Exercises
  4. 3 Creating and Working in Documents
    1. Chapter Scenario
    2. 3.1 Navigating Microsoft Word
    3. 3.2 Formatting Document Layout in Microsoft Word
    4. 3.3 Formatting Document Content in Microsoft Word
    5. 3.4 Collaborative Editing and Reviewing in Microsoft Word
    6. 3.5 Document Design
    7. 3.6 Navigating Google Docs
    8. 3.7 Formatting Layout and Content in Google Docs
    9. 3.8 Collaborative Editing and Reviewing in Google Docs
    10. 3.9 Versions and Version History
    11. Chapter Review
      1. Key Terms
      2. Summary
      3. Review Questions
      4. Practice Exercises
      5. Written Questions
      6. Case Exercises
  5. 4 Document Preparation
    1. Chapter Scenario
    2. 4.1 Microsoft Word: Advanced Formatting Features
    3. 4.2 Working with Graphics and Text Tools in Microsoft Word
    4. 4.3 Managing Long Documents in Microsoft Word
    5. 4.4 Google Docs: Enhanced Formatting Features
    6. 4.5 Working with Graphics and Text Tools in Google Docs
    7. 4.6 Managing Long Documents in Google Docs
    8. Chapter Review
      1. Key Terms
      2. Summary
      3. Review Questions
      4. Practice Exercises
      5. Written Questions
      6. Case Exercises
  6. 5 Advanced Document Preparation
    1. Chapter Scenario
    2. 5.1 Creating Different Document Types in Microsoft Word
    3. 5.2 Mail Merge in Microsoft Word
    4. 5.3 Creating Forms in Microsoft Word
    5. 5.4 Creating Different Document Types in Google Docs
    6. 5.5 Creating Forms in Google Docs
    7. 5.6 Advanced Collaboration in Google Docs
    8. Chapter Review
      1. Key Terms
      2. Summary
      3. Review Questions
      4. Practice Exercises
      5. Written Questions
      6. Case Exercises
  7. 6 Preparing Presentations
    1. Chapter Scenario
    2. 6.1 Presentation and Design Essentials
    3. 6.2 Designing a Presentation in Microsoft PowerPoint
    4. 6.3 Formatting Microsoft PowerPoint Slides: Layout and Design Principles
    5. 6.4 Adding Visuals and Features to Microsoft PowerPoint Slides
    6. 6.5 Designing a Presentation in Google Slides
    7. 6.6 Creating Google Slides: Layout and Text
    8. 6.7 Adding Visuals and Features to Google Slides
    9. Chapter Review
      1. Key Terms
      2. Summary
      3. Review Questions
      4. Practice Exercises
      5. Written Questions
      6. Case Exercises
  8. 7 Advanced Presentation Skills
    1. Chapter Scenario
    2. 7.1 Effective Presentation Skills
    3. 7.2 Finalizing a Slide Collection
    4. 7.3 Preparing a Microsoft PowerPoint Collection for Presentation
    5. 7.4 Preparing a Google Slides Collection for Presentation
    6. Chapter Review
      1. Key Terms
      2. Summary
      3. Review Questions
      4. Practice Exercises
      5. Written Questions
      6. Case Exercises
  9. 8 Content Management Systems and Social Media in Business
    1. Chapter Scenario
    2. 8.1 What Are Content Management Systems?
    3. 8.2 Common Content Management Systems
    4. 8.3 Creating Content with a Content Management System
    5. 8.4 Search Engine Optimization
    6. 8.5 Social Media in Business
    7. Chapter Review
      1. Key Terms
      2. Summary
      3. Review Questions
      4. Practice Exercises
      5. Written Questions
      6. Case Exercises
  10. 9 Working with Spreadsheets
    1. Chapter Scenario
    2. 9.1 Microsoft Excel Basics
    3. 9.2 Text and Numbers in Microsoft Excel
    4. 9.3 Calculations and Basic Formulas in Microsoft Excel
    5. 9.4 Formatting and Templates in Microsoft Excel
    6. 9.5 Google Sheets Basics
    7. 9.6 Text and Numbers in Google Sheets
    8. 9.7 Calculations and Basic Formulas in Google Sheets
    9. 9.8 Formatting and Templates in Google Sheets
    10. Chapter Review
      1. Key Terms
      2. Summary
      3. Review Questions
      4. Practice Exercises
      5. Written Questions
      6. Case Exercises
  11. 10 Advanced Excel Formulas, Functions, and Techniques
    1. Chapter Scenario
    2. 10.1 Data Tables and Ranges
    3. 10.2 More About Formulas
    4. 10.3 Using Arithmetic, Statistical, and Logical Functions
    5. 10.4 PivotTables
    6. 10.5 Auditing Formulas and Fixing Errors
    7. 10.6 Advanced Formatting Techniques
    8. Chapter Review
      1. Key Terms
      2. Summary
      3. Review Questions
      4. Practice Exercises
      5. Written Questions
      6. Case Exercises
  12. 11 Advanced Excel Spreadsheets: Statistical and Data Analysis
    1. Chapter Scenario
    2. 11.1 Understanding Data, Data Validation, and Data Tables
    3. 11.2 Statistical Functions
    4. 11.3 What-If Analysis
    5. 11.4 PivotTables/Charts
    6. 11.5 Data Analysis Charts
    7. Chapter Review
      1. Key Terms
      2. Summary
      3. Review Questions
      4. Practice Exercises
      5. Written Questions
      6. Case Exercises
  13. 12 Using Excel in Accounting and Financial Reporting
    1. Chapter Scenario
    2. 12.1 Basic Accounting
    3. 12.2 Financial Functions in Microsoft Excel
    4. 12.3 Integrating Microsoft Excel and Accounting Programs
    5. Chapter Review
      1. Key Terms
      2. Summary
      3. Review Questions
      4. Practice Exercises
      5. Written Questions
      6. Case Exercises
  14. 13 Understanding and Using Databases
    1. Chapter Scenario
    2. 13.1 What Is a Database?
    3. 13.2 Microsoft Access: Main Features and Navigation
    4. 13.3 Querying a Database
    5. 13.4 Maintaining Records in a Database
    6. 13.5 Creating Reports in Microsoft Access
    7. 13.6 Creating Forms in Microsoft Access
    8. Chapter Review
      1. Key Terms
      2. Summary
      3. Review Questions
      4. Practice Exercises
      5. Written Questions
      6. Case Exercises
  15. 14 Advanced Database Use
    1. Chapter Scenario
    2. 14.1 Advanced Queries in Microsoft Access
    3. 14.2 Multiple Table Forms
    4. 14.3 Customizing Forms
    5. 14.4 Customizing Reports
    6. 14.5 Using Macros
    7. 14.6 Data Analysis and Integration
    8. Chapter Review
      1. Key Terms
      2. Summary
      3. Review Questions
      4. Practice Exercises
      5. Written Questions
      6. Case Exercises
  16. 15 Integrating Applications
    1. Chapter Scenario
    2. 15.1 Microsoft 365: Collaboration and Integration
    3. 15.2 Microsoft Word: Integration with Microsoft Excel and Microsoft Access
    4. 15.3 Microsoft Word and Microsoft PowerPoint Integration
    5. 15.4 Microsoft Excel and Microsoft PowerPoint Integration
    6. 15.5 Microsoft Excel and Microsoft Access Integration
    7. 15.6 Integrating Data from Other Programs into Google Workspace
    8. 15.7 New Developments: The Role of Artificial Intelligence
    9. 15.8 Mastering Workplace Software Skills: A Project
    10. Chapter Review
      1. Key Terms
      2. Summary
      3. Review Questions
      4. Practice Exercises
      5. Written Questions
  17. Index

Learning Objectives

By the end of this section, you will be able to:

  • Create complex formulas
  • Use cell references in formulas
  • Use comparison operators
  • Use arrays in formulas

Portland is a small city in Cumberland County, Maine, and is Maine’s most populous city. Its main commercial attraction is that it is a port city, and among the main economic activity in the region is marine transport services. WorldCorp has an office there, as the company uses the port facilities to export some of their products to different destinations. The WorldCorp regional manager has to use intricate spreadsheets to keep track of the large volume of cargo coming from different cities in the United States. The manager wants to start using data automation intelligence tools in Excel, allowing the manager to make operational decisions more quickly.

The shipping information may contain data such as the origin city, the destination, types of inventory included in the cargo, the weight of each shipment, and specific international shipping terms for the shipment. The manager receives this information separately in each bill of lading (a summary of the shipment) and has constructed many complex Excel workbooks with different tabs, each containing the raw data from the cargo. With shipments increasing year by year, this raw data has grown and become unwieldy. Using Excel’s built-in analytical tools, such as cell references, comparison operators, and array formulas, the manager can make sense of this raw data to use and process it in a more helpful way.

As a WorldCorp employee, you are asked to deliver recurring reports based on this data. These reports can be tedious to create if you are not able to immediately find the information you need in your spreadsheets. In this case, you are asked to find the heaviest shipment, the average tonnage, the most-used destination, and other report highlights.

Excel’s analytical tools like cell references, comparison operators such as greater than (>), and array formulas allow all the information in your spreadsheet to be summarized automatically. Using comparison operators enables powerful functions that are used for different purposes when constructing array formulas. Cell reference notations—relative, absolute, and mixed—are used to construct automated tables. A relative cell reference means that the cell used in the formula will change if it is copied to another part of the spreadsheet. More specifically, both the column and row location are not fixed. An absolute cell reference occurs when both the row and the column are fixed to that exact cell, so if you copy the formula to another location in the spreadsheet, it will always reference the same cell. A mixed cell reference is when either the column or the row is fixed. If the column is fixed, the row will be relative when copied to another location in the spreadsheet, and if the row is fixed, the column will be relative. Understanding cell reference notations will help you learn to build and use complex formulas using the correct order of operations. More advanced use of cell references will allow you to use comparison operators and arrays in different situations.

Complex Formulas

As calculations grow in complexity, they require the use of several operators, such as +, –, /, *, and ^, in the same formula. This is the basic definition of a complex formula, a formula that uses several operators to calculate an output. One important aspect of complex formulas is that Excel will automatically calculate them in a specific order. When first working with complex formulas, it can be helpful to write out the formula on paper first. To input formulas into Excel, use parentheses to separate the different mathematical functions. Multiple parentheses might be needed when working with complex and long formulas. For example, to add cells A1 and B1 and then divide by cell C1, it would look like A1+B1 C1 A1+B1 C1 if you wrote out the formula. In Excel, the formula is one single line: =(A1+B1)/C1. Another strategy when dealing with complex formulas is to break down the formula into parts. To break down the previous example, you would do the addition part of the equation in one cell, and then in the next cell, do the division. Excel employs a color-coding system in complex formulas to help you follow the math, as shown in Figure 10.16.

Cell D7 displays =(E2+E3+E4 in the formula box. Cell D7 displays the formula and E2 is highlighted blue, E3 red, E4 purple. The corresponding cells are highlighted the same colors.
Figure 10.16 The color-coding system for complex formulas is also applied when using multiple sets of parentheses in a formula. (Used with permission from Microsoft)

Insert Function Tool

Recall, the Formula Bar is located right above the lettered columns, right beneath the ribbon. The Formula Bar can be used for double-checking that what you typed in the cell was what you intended, or for editing the relative cell references of a copied cell. However, there is another feature in the Formula Bar using the Insert Function tool, which is essentially an assistant to help users build formulas. It contains the whole roster of Excel functions, categorized by discipline (e.g., engineering, financial, math and trigonometry, statistical), so users can explore and search for functions. Insert Function is activated by clicking on the “ƒx” icon that you see in the Formula Bar, or by going to the Formulas tab, and selecting Insert Function. The Function Library command group on the Formulas tab also shows formulas grouped by category.

Mac Tip

In the Mac version, the Formula Bar only shows the most commonly used formulas, but you can expand the Formulas tab.

Let’s examine how to use the Insert Function tool for a simple function, the SUM function. (Note that the Insert Function tool is typically used for more complex and specialized functions because it is quick and easy to just type in the simple formulas; however, here, the SUM function provides a simple example.) First, select the cell where you want the summed total to appear. Then, click on the Insert Function icon. The dialog box will open, asking for the function you want to use; select the Math & Trig category, and look for SUM (they are listed alphabetically). When selected, a second screen will appear and ask for the range on which to perform the addition. Select the range and then click OK.

Mac Tip

In the Mac version, the Formula Builder defaults to the last formula you used.

One useful feature of the Insert Function tool is that it can automatically detect what your range might be (Figure 10.17a). In Figure 10.17b, Excel automatically guessed that the user would want to sum the range F2:F5. This Insert Function tool is useful when you do not want to manually type the formula in the Formula Bar.

(a) Insert Function is selected. (b) Column F is highlighted in spreadsheet. Function Arguments pane selected Number1 F2:F5 for SUM and the Formula result = $ 7,539,906.10.
Figure 10.17 The Insert Function tool includes tips on how to apply each function. (Used with permission from Microsoft)

Order of Operations

In all math equations, there are rules regarding the order in which calculations must be completed. Otherwise, the equation result will be incorrect. The order of operations is the universal law of math used to prescribe the order of doing each calculation in an equation: parentheses, exponents, multiplication, division, addition, and subtraction, going from left to right (the acronym PEMDAS can help you remember the order). For example, if you calculate 5+3*3–5 from left to right, you would add 5 and 3 to get 8, then multiply 8 by 3 to get 24, and then subtract 5 to get 19, which is incorrect. Following the mathematical order of operations, the equation should be done in this order: multiply 3 by 3 to get 9, then add 5 to get 14, then subtract 5 to get 9. You can also use parentheses to help show the correct order of operations, such as 5+(3*3)–5. The parentheses show that the multiplication should be done first. Excel requires equations to follow the correct order of operations, using parentheses when combining operations in a single cell.

Let’s look at some WorldCorp revenue streams to see this on a larger scale. WorldCorp produces thousands of different consumer electronic products, including TVs. Figure 10.18 shows the number of TVs sold for each of these models in the Volume Sold column. To calculate the margin for each model, subtract the cost from the price. Then, to calculate the profit per each model (Marginal Profit), multiply the margin by the volume sold.

A spreadsheet provides the following columns of information: Model, Price, Cost, Margin, Volume Sold, and Marginal Profit. The last row provides a total for the Marginal profit column.
Figure 10.18 Several simple formulas were used to calculate the profit margin for each model. (Used with permission from Microsoft)

To calculate the total profit margin, you can use the SUM function on the Marginal Profit column. This simply adds up all of the profit margin amounts for each model. Alternatively, you can get this same total by creating a complex formula. Subtract the cost from the price, then multiply the difference by the volume sold, then add the product of each model and the quantity. Remember to use parentheses to make sure that each section of the formula is completed in the right order. The formula would look something like this: =((Price1-Cost1)*Volume Sold1)+((Price2-Cost2)*Volume Sold2)+((Price3-Cost3)*Volume Sold3) [etc.].

The calculation in Figure 10.19a shows the wrong answer that would result from not using parentheses in the formula. It uses the formula =Price1-Cost1*Volume Sold1+Price2-Cost2*Volume Sold2+Price3-Cost3*Volume Sold3 [etc.], which means the cost is multiplied by the volume sold first, before being subtracted from the price, which is not correct. Figure 10.19b shows the formula written the correct way (with the parentheses). It uses =((B4-C4)*D4)+((B5-C5)*D5)+((B6-C6)*D6)+((B7-C7)*D7), which gives the correct result.

(a) Cell D8 is selected and Formula bar displays=B4-C4*D4+B5-C5*D5+B6-C6*D6+B7-C7*D7. $(6,582,923.90) displays in the cell. (b) Cell D8 is selected. Formula bar displays =((B4-C4)*D4)+((B5-C5)*D5)+((B6-C6)*D6)+((B7-C7)*D7). $7,539,906.10 is inside cell D8.
Figure 10.19 In (a) the volume sold is incorrect because the parentheses that determine the order of operations in the formula are missing; (b) is correct. These formulas show how easy it is to make a mistake in the order of operations. (Used with permission from Microsoft)

Cell References in Formulas

In Defining, Selecting, and Naming a Cell Range, you learned about cell references and how to define a range of cells. Now, we will expand this into Excel’s cell reference notation and learn how to use relative, absolute, and mixed cell references.

Relative Cell References

Formulas use relative cell references by default in Excel. A relative cell reference is one in which the cell reference in a formula or function updates automatically to reference an adjacent cell when you copy that formula or function to another cell; in other words, if your formula refers to cells A2 and B2, Excel knows that this means the columns are next to one another and in the same row. If you copy a formula with these values to the next row, Excel will automatically change the cell references to A3 and B3.

Let’s consider an example. You want to replicate the TV profit calculation =((B4-C4)*D4)+((B5-C5)*D5)+((B6-C6)*D6)+((B7-C7)*D7) in another table with different models of TVs. You simply need to copy (Ctrl+C) the cell with the formula in it (D8), and paste (Ctrl+V) it into a new cell (D15). As shown in Figure 10.20a, all of the Price, Cost, and Volume Sold values in the new table are different, and cell D15 is blank. Once you copy the formula into cell D15 (as in Figure 10.20b), the result is that the formula will be exactly the same, but the cell references will automatically be changed to reflect the new table: =((B11-C11)*D11)+((B12-C12)*D12)+((B13-C13)*D13)+((B14-C14)*D14). As a word of caution, this only works if the tables are uniform and the formulas needed are the same.

(a) Cell D8 is selected; Formula bar displays =((B4-C4)*D4)+((B5-C5)*D5)+((B6-C6)*D6)+((B7-C7)*D7). Cell D8 displays $7,539,906.10. Cell D15 is blank. (b) Cell D15 is selected. Formula bar displays =((B11-C11)*D11)+((B12-C12)*D12)+((B13-C13)*D13)+((B14-C14)*D14). Cell D15 shows $6,507,235.00.
Figure 10.20 Because the tables are identical in size and column values, the formula from (a) the first table will work perfectly when copied to (b) the second table. (Used with permission from Microsoft)

Mac Tip

As a reminder, all shortcuts that use Ctrl on a PC use Command on a Mac.

Yet, as easy as relative cell references can be, they might not be appropriate for all circumstances. For example, you may have a set of informational data that will be used recurrently, but you don’t want Excel to move the reference of one or more cells, so the relative cell reference function will not work. This is when a different type of cell reference can be used.

Absolute Cell References

An absolute cell reference is one in which the cell reference is fixed, regardless of where you copy the formula. To use the absolute cell reference feature, put a “$”before the column and row reference. For example, $A$3 means that the reference to column A, row 3 is fixed. If you don’t add both “$” symbols, the absolute cell reference won’t work, and you will simply have a relative cell reference. Another way to use the absolute cell reference is with a shortcut. Click on the cell you would like to fix, and then click F4, and Excel will automatically add the “$” to the cell.

Recall the loan you were analyzing for WorldCorp, but instead of using a Data Table What-If Analysis, you will use the PMT function and absolute cell references. As shown in Figure 10.21a, the same loan interest rate data remains, but now you will calculate the payments using absolute references. The formula in cell F3: =PMT(E3,$C$2,-$C$4,0,0). You can click on the fill handle (the lower-right corner of the cell) of cell F3 and drag it to F9. This copies the formula so that all the PMTs will automatically be calculated for you, using the fixed references to cells C2 and C4. Figure 10.21b shows the completed table, and the formula in cell F9 shows the updated formula with absolute cell references.

(a) Cell C5 is selected. Formula bar displays =PMT(C3,C2,-C4,0). $104,328.52 shows in the cell. In Part b, Cell F9 is selected. Formula bar displays =PMT(E9,$C$2,-$C$4,0,0). $111,772.12 is in the cell.
Figure 10.21 Using absolute cell references allows you to copy the formula to other cells without having to update your formula. (a) The PMT formula in cell C5 calculates it using relative cell references. (b) Using the absolute cell references for cells C2 and C4, you can create a table that shows the payment for various interest rates. (Used with permission from Microsoft)

Let’s examine this formula without absolute cell references; in other words, using relative cell references. If cell F3 is =PMT(E3,C2,-C4,0,0), and you drag the fill handle to cell F9, then all the values from F4 to F9 will be incorrect (Figure 10.22). Essentially, you have copied the same formula, but the relative cell references have moved location along with the location of the formula. Instead of referring to cells C2 and C4 for each iteration of the formula, the reference moved down one row for each row you copied the formula down the table.

SUM in Name box. Formula bar displays =PMT(E9,C8,-C10,0,0). Cell E9 (blue), C8 (red), C10 (purple), C8 (red/empty), C10 (purple/empty), E9 (blue; 8.00%), F9 (selected/formula inside), F7 and F8 (#NUM!/green triangles in corners).
Figure 10.22 Using absolute cell references will avoid errors in your formulas when you are using the same cell in each of your formulas. (Used with permission from Microsoft)

Real-World Application

Excel Horror Stories

Even the employee with the most certifications and skills in Excel can make mistakes. Excel facilitates most computations, but if the user makes an error in the formula or with entering the data, there can be significant consequences. For instance, you might think copying and pasting information would reduce errors. However, that was not the case for an employee working at JP Morgan Chase. In 2012, an employee copied and pasted content and formulas from one spreadsheet to another while working on a Value Risk model. The data and formulas were untested and unverified, and errors were carried over into the model.

You should also consider the veracity and completeness of files you might receive. Barclays ended up purchasing 179 contracts they did not want from the Lehman Brothers in 2008. Why? They received a spreadsheet of Lehman’s assets, in PDF form. When they reviewed the Excel spreadsheet, they identified 179 contracts they did not want to purchase and hid those rows, but those notes were omitted from the PDF when it was converted, and the hidden rows were visible. Excel is a very powerful tool; with that power comes the potential for grave mistakes that can be incredibly costly. The utmost care and integrity must be taken to ensure fidelity of any spreadsheet generated and/or shared.

Mixed Cell References

A mixed cell reference uses a combination of both relative and absolute cell references. A mixed cell reference might have a fixed row but a relative column or a fixed column but a relative row. When the “$” is directly to the left of the row number only (e.g., B$1), the row is absolute and the column is relative. When the “$” is directly to the left of the column only (e.g., $B1), the column is absolute and the row is relative.

Let’s look at another example. The WorldCorp Portland, Maine, location offers different promotional discounts as a percentage of the TV retail price depending on the month. The manager asks you to create an autofilled table of the unit prices per TV model for the year 2020. That is easy to achieve manually, multiplying the monthly discount times the retail price, but each cell reference has to be fixed as they move. To automate the calculation, you can use mixed cell references. Figure 10.23 shows the retail prices per unit and the monthly discount rates.

Column B lists TV Model information starting in Row 8. Column C lists Months, and Shipping/Price information. Columns D to O list months and percentages for Profits. Formula bar displays =$C9*(1-D$4).
Figure 10.23 Calculating outputs from tables with two sets of variables can be a good use of mixed cell references. (Used with permission from Microsoft)

In Figure 10.24, the discounted retail price for model 32" LCD #E-900s is $168.30 to be calculated in cell D9. This is obtained by multiplying the Price in column C9 by (1-discount rate found in cell D5). For this example, this would be 170*(1-0.01) or C9*(1-D5). Without absolute cell references for either the column or row, the table will not calculate correctly when the formula is copied (see Figure 10.23). Placing the $ before the column (column C) for the price will fix the formula to always calculate the output based on column C, and the table will fill properly with the discounted prices when you copy the formula from D9 into the remaining cells.

Two table visible. Upper table lists monetary values for discounts in Columns R to X. Lower table is blank except for cell R12 (selected) with $168.30 entered.
Figure 10.24 By having the columns fixed, the formula always references the Price column. (Used with permission from Microsoft)

Comparison Operators

The Excel comparison operators are the same as the inequality symbols used in math. These are: < (less than), > (greater than), or >= (greater than or equal to), or <= (less than or equal to), = (equal to), and <> (not equal to). Comparison operators can be used for comparing numbers. Comparison operators are valuable because of their use in the IF functions. With the IF function (or similar functions like SUMIF, COUNTIF, etc.), comparison operators can automatically search for important information. More will be covered about these functions in Logical Functions.

Arrays in Formulas

Array formulas can save time when used for basic or intermediate calculations (recall saving the time of adding an extra column in Figure 10.15). But more importantly, array formulas are used for higher-level calculations that may involve statistical and financial analysis, such as figuring out maximums and minimums of a certain product (similar to MINIF and MAXIF functions) or summing certain X or Y rows/columns (similar to SUMIF). In short, most array applications can be done in other ways in Excel, but using arrays allows you to do multiple calculations at the same time.

Let’s use a manufacturing example to see how to use arrays in formulas. WorldCorp’s Fairfax, Virginia, manufacturing plant transports their items by truck to the Portland, Maine, location. The Fairfax plant has plenty of stock for some of the items in the orders, but not for all of them. Figure 10.25 shows the available stock in the Fairfax plant (Quantity In Stock) and the amounts needed to complete the orders (Quantity Planned). Let’s calculate the difference between these two numbers to determine if more is needed. Specifically, if the Quantity in Stock (Column E) is larger than the Quantity Planned (Column D), we will not need to manufacture more. To make this simple, we will use a simple subtraction calculation: Quantity in Stock – Quantity Planned. If this value is a positive number, there is plenty in stock. This would be the case with Row 6 – Tablets 7in. The Quantity in Stock is 425 and the Quantity planned is 143. So, 425 – 143 = 282. So, there will be 282 units remaining after filling the Quantity Planned order. If the value of the subtraction formula is negative, then more product is needed. We see this in Row 4 where the Quantity in Stock is 464, but 542 are Planned. Using the equation, 464 – 542, we are left with a shortfall of 78 units or -78. First, determine the difference between the values in Column E and Column D using an array. This will allow us to do the calculations for all rows in one step. Highlight cells G4 to G12. Then, in the Formula Bar, type the formula: E4:E12 – D4:12 (Figure 10.25a), and then press Ctrl+Shift+Enter simultaneously for the curly braces to appear, as shown in Figure 10.25b. The formula then is automatically entered for all highlighted rows.

(a) Formula bar displays =E4:E12 - D4:D12 in blue (Column E) and red (Column D). Cell G4 displays D4:D12. (b) Formula bar displays {=E4:E12 - D4:D12}. Column G displays positive/negative numbers.
Figure 10.25 Make sure to highlight all the cells you want the formula to be entered into. (a) Notice the color coding of the formula that corresponds to the colors in the columns below. (b) If you don’t press the Ctrl+Shift+Enter combination, the array will not work. You will see the curly braces when you have a formula as an array. (Used with permission from Microsoft)
Citation/Attribution

This book may not be used in the training of large language models or otherwise be ingested into large language models or generative AI offerings without OpenStax's permission.

Want to cite, share, or modify this book? This book uses the Creative Commons Attribution License and you must attribute OpenStax.

Attribution information
  • If you are redistributing all or part of this book in a print format, then you must include on every physical page the following attribution:
    Access for free at https://openstax.org/books/workplace-software-skills/pages/1-chapter-scenario
  • If you are redistributing all or part of this book in a digital format, then you must include on every digital page view the following attribution:
    Access for free at https://openstax.org/books/workplace-software-skills/pages/1-chapter-scenario
Citation information

© Jan 3, 2024 OpenStax. Textbook content produced by OpenStax is licensed under a Creative Commons Attribution License . The OpenStax name, OpenStax logo, OpenStax book covers, OpenStax CNX name, and OpenStax CNX logo are not subject to the Creative Commons license and may not be reproduced without the prior and express written consent of Rice University.