Logo
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
EPL Standings
 
 
Windows 7

Microsoft Excel 2010 : Calculating the Mode (part 3) - Getting the Mode of Categories with a Formula - Accommodating a Function’s Arguments

2/6/2014 3:16:43 AM
Recapping the Array Formula

To review how the array formula counts the values for the modal category of Ford, consider the following:

  • The formula’s purpose is to count the number of instances of the modal category, Ford, whose name is in cell C1.

  • The innermost fragment in the formula, A2:A21=C1, returns an array of 20 TRUE or FALSE values, depending on whether each of the 20 cells in A2:A21 contains the same value as is found in cell C1.

  • The IF() function examines the TRUE/FALSE array and returns another array that contains 1’s where the TRUE/FALSE array contains TRUE, and 0’s where the TRUE/FALSE array contains FALSE.

  • The SUM() function totals the values in the array of 1’s and 0’s. The result is the number of cells in A2:A21 that contain the value in cell C1, which is the modal value for A2:A21.

Using an Array Formula

Various reasons exist for using array formulas in Excel. Two of the most typical reasons are to support a function that requires it and to enable a function to work on more than just one value.

Accommodating a Function

One reason you might need to use an array formula is that you’re employing a function that must be array-entered if it is to return results properly. For example, the FREQUENCY() function, which counts the number of values between a lower bound and an upper bound requires that you enter it in an array formula. Another function that requires array-entry is the LINEST() function.

Both FREQUENCY() and LINEST(), along with a number of other functions, return an array of values to the worksheet. You need to accommodate that array. To do so, begin by selecting a range of cells that has the number of rows and columns needed to show the function’s results. (Knowing how many rows and columns to select depends on your knowledge of the function and your experience with it.) Then you enter the formula that calls the function by means of Ctrl+Shift+Enter instead of simply Enter; again, this sequence is called array entering the formula.

Accommodating a Function’s Arguments

Sometimes you use an array formula because it employs a function that usually takes a single value as an argument, but you want to supply it with an array of values. The example in cell C2 of Figure 2 shows the IF() function, which usually expects a single condition as its first argument, accepting an array of TRUE and FALSE values as its first argument:

=SUM(IF(A2:A21=C1,1,0))

Typically, the IF() function deals with only one value as its first argument. For example, suppose you want cell C2 to show the value “Current” if cell A1 contains the value 2010; otherwise, B1 should show the value “Past”. You could put this formula in B1, entered normally with the Enter key:

=IF(A1=2010,“Current”,“Past”)

You can enter that formula normally, via the Enter key, because you’re handing off just one value, 2010, to IF() as its first argument.

However, the example concerning the number of instances of the mode value is this:

=SUM(IF(A2:A21=C1,1,0))

The first argument to IF() in this case is an array of TRUE and FALSE values. To signal Excel that you are supplying an array rather than a single value as the first argument to IF(), you enter the formula using Ctrl+Shift+Enter, instead of the Enter key alone as you usually would for a normal Excel formula or value.

Looking Inside a Formula

Excel has a couple of tools that come in handy from time to time when a formula isn’t working exactly as you expect—or when you’re just interested in peeking inside to see what’s going on. In each case you can pull out a fragment of a formula to see what it does, in isolation from the remainder of the formula.

Other -----------------
- Microsoft Visio 2010 : Modifying a Graphic (part 6) - Adding a Picture Style and Effects
- Microsoft Visio 2010 : Modifying a Graphic (part 5) - Adjusting Brightness and Contrast
- Microsoft Visio 2010 : Modifying a Graphic (part 4) - Cropping a Graphic
- Microsoft Visio 2010 : Modifying a Graphic (part 3) - Changing a Graphic’s Position
- Microsoft Visio 2010 : Modifying a Graphic (part 2) - Wrapping Text Around a Graphic
- Microsoft Visio 2010 : Modifying a Graphic (part 2) - Wrapping Text Around a Graphic
- Microsoft Visio 2010 : Modifying a Graphic (part 1) - Resizing a Graphic
- Microsoft Visio 2010 : Adding Graphics to Your Documents - Adding Clip Art to a Document - Finding and Inserting a Clip Art Graphic
- Microsoft Visio 2010 : Adding a Photo to a Document
- Editing Digital Video with Windows Live Movie Maker (part 9) - Sharing Your Videos - Outputting to the PC
- Editing Digital Video with Windows Live Movie Maker (part 8) - Sharing Your Videos - Publishing to the Web
- Editing Digital Video with Windows Live Movie Maker (part 7) - Editing Your Video - Getting a Bit More Sophisticated
- Editing Digital Video with Windows Live Movie Maker (part 6) - Editing Your Video - Trimming Video and Audio
- Editing Digital Video with Windows Live Movie Maker (part 5) - Editing Your Video - Using Titles
- Editing Digital Video with Windows Live Movie Maker (part 4) - Editing Your Video - Adding Transitions
- Editing Digital Video with Windows Live Movie Maker (part 3) - Importing Content
- Editing Digital Video with Windows Live Movie Maker (part 2) - Understanding the Movie Maker User Interface
- Editing Digital Video with Windows Live Movie Maker (part 1) - Starting Windows Live Movie Maker
- Managing Digital Movies (part 4) - Watching and Managing Movies with Windows Media Center
- Managing Digital Movies (part 3) - Watching and Managing Movies with Windows Media Player,
 
 
Most view of day
- Windows Server 2012 Administration : Defining the Administrative Model
- Microsoft Dynamic CRM 4 : Data Migration (part 3) - Creating a CRM Adapter Publisher
- Managing SharePoint 2010 with Windows PowerShell : Managing Permissions in SharePoint 2010, Managing Content Databases in SharePoint 2010
- Microsoft Dynamics CRM 4 : Scribe Integration - Scribe Insight Architecture
- Developing with SharePoint 2010 (part 4) - Developer Toolbar
- SQL Server 2012 : Running SQL Server in A Virtual Environment - ARCHITECTING SUCCESSFUL VIRTUAL DATABASE SERVERS
- Microsoft SharePoint 2013 : Looking at Visio Services (part 2) - Adding a Visio Web Access Web Part to a page
- Troubleshooting Hardware, Driver, and Disk Issues : How to Use Built-In Diagnostics (part 3)
- Windows Server 2008 : Configuring Server Core after Installation (part 2) - Restoring the Command Prompt , Renaming the Computer
- Sharepoint 2013 : Backup and Restore (part 6) - Farm Backup and Restore - Performing a Restore, Using PowerShell
Top 10
- Windows Server 2012 : DHCP,IPv6 and IPAM - Exploring DHCP (part 3) - Creating IPv4 DHCP Scopes
- Windows Server 2012 : DHCP,IPv6 and IPAM - Exploring DHCP (part 2) - Installing DHCP Server and Server Tools
- Windows Server 2012 : DHCP,IPv6 and IPAM - Exploring DHCP (part 1)
- Windows Server 2012 : DHCP,IPv6 and IPAM - Understanding the Components of an Enterprise Network
- Microsoft OneNote 2010 : Using the Research and Translate Tools (part 3) - Translating Text with the Mini Translator
- Microsoft OneNote 2010 : Using the Research and Translate Tools (part 2) - Translating a Word or Phrase with the Research Pane
- Microsoft OneNote 2010 : Using the Research and Translate Tools (part 1) - Setting Options for the Research Task Pane, Searching with the Research Task Pane
- Microsoft OneNote 2010 : Doing Research with Linked Notes (part 2) - Ending a Linked Notes Session, Viewing Linked Notes
- Microsoft OneNote 2010 : Doing Research with Linked Notes (part 1) - Beginning a Linked Notes Session
- Microsoft OneNote 2010 : Doing Research with Side Notes (part 3) - Moving Side Notes to Your Existing Notes
 
 
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro