internet.com
You are in the: Small Business Computing Channelarrow
Small Business Technology
» ECommerce-Guide | Small Business Computing | Webopedia | WinPlanet |Refer-It

WinPlanet Software Downloads and Reviews for Small Businesses
Search
Power Search | Tips
-
Navigate WinPlanet
WinPlanet Home Page

Software
Download Index
In-Depth Reviews
Tips & Tutorials
Updates
News

Software Categories
Browsers
Chat / Conferencing
Desktop Utilities
Development
Internet Apps
Multimedia
OS Service Packs
Productivity Tools

Software Glossary

WinPlanet Newsletter

internet.commerce
Partners & Affiliates













Small Business Computing
Small Business Computing
Ecommerce Guide
Webopedia
WinPlanet

WinPlanet / Tips & Tutorials

Download of the day
Internet Explorer 8

Most Popular Software Downloads
Mozilla Firefox 3.0
Ad-Aware 2008 Free
Internet Explorer 7
QuickTime for Windows
Paint Shop Pro
Mozilla Firefox Portable Edition 3
AVG Anti-Virus Free
Windows XP Service Pack 3
Ashampoo WinOptimizer
Adobe Flash Player
Windows Live Suite

Most Popular Software Articles
Windows Vista Tips & Tricks, Part 1
Windows Vista: Worthy of the Hype?
Windows Wireless Zero Configuration: Five Steps to Sanity


Software Reviews

Using Excel's Array Formulas
Arrays of Light
Helen Bradley

Wed 2/6/02 -- Some of the best-kept secrets about Microsoft Excel are its array formulas. These are simple formulas to create, yet they offer the ability to perform calculations in one step that would take many steps if done another way. If you've used Excel for a while, you've probably already encountered situations in which an array formula could come in handy.

Multiply and add. One of the simplest array formulas is one that multiplies a set of numbers in one column by the numbers in the column to the right, and then adds the results. Say your numbers are in the range B1:C10. This formula performs the multiplication and addition in one cell:

=SUM(B1:B10*C1:C10)

To enter it, like all array formulas, you type it, then press Control-Shift-Enter instead of just Enter. If you don't, you'll get a #VALUE! error -- which is easily overcome by pressing F2 as if to edit the cell's contents, then Control-Shift-Enter to reenter the formula correctly. An array formula displays inside a set of curly braces.

Big deal, the Excel wizards in the back row are saying; this array formula gives the same result as using SUMPRODUCT. True, but array formulas let you create calculations to perform complex tasks, which means you don't have to rely on Excel to provide the functions for you. For example ...

Conditional summing. Our friends in the back row are familiar with SUMIF, which allows you to sum a range of values if they meet a condition. But that function can test for only one condition. And while the Conditional Sum Wizard add-in can test for multiple conditions, it can only do so using AND -- it can't perform tests which require an OR operator.

Array formulas don't have these limitations. Using the spreadsheet fragment shown below, here are two array formulas which show how you can sum on the basis of a test for multiple conditions using both AND and OR.

Summing using AND. If you want to calculate the value of hardware sold to Brown, you'd use an AND operator -- the value in column A must be Brown, and the value in column B must be Hardware. This array formula provides the answer (720):

=SUM((A2:A8="Brown")*(B2:B8="Hardware")*(C2:C8))

Summing using OR. What if you want to calculate the value of goods sold to Smith and Jones? You'll use an OR operator -- the value in column A must be either Smith or Jones. This array formula performs the calculation to give the answer (900):

=SUM(((A2:A8="Smith")+(A2:A8="Jones"))*(C2:C8))

How the tests work. Both of these formulas rely on the conditions in brackets returning an answer of true or false (1 or 0) depending on the value of the cell in column A. You can test this by typing =(A2="Smith") into a vacant cell; you'll see the result (TRUE or FALSE) depending on the contents of cell A2.

In each case, the results of the two tests are multiplied or added to give an appropriate multiplier for the remainder of the formula. This provides a result which is the equivalent of using an AND or OR operator.

In the formula =SUM((A2:A8="Brown")*(B2:B8="Hardware")*(C2:C8)), if either or both tests are false, you'll get a multiplier of 0, which effectively removes that line from the calculation. Only if both tests are true will you get a multiplier of 1, ensuring that the line is included in the sum.

Other functions. Array formulas aren't limited to adding values together. You can use other functions in your calculations, including AVERAGE, MAX, MIN, and so on. For example, this array formula returns the average of all hardware purchases made by Brown:

=AVERAGE(IF((A2:A8="Brown")*(B2:B8 ="Hardware"),C2:C8))

Here we've used an IF test written so it performs as an AND operator, to extract only those figures in the range C2:C8 for which Brown and Hardware appear in columns A and B, respectively. These figures are then passed to the AVERAGE function, which returns the required answer.

Similarly, you can calculate the average of Smith's and Jones's purchases using an IF test that performs as an OR operator, extracting values in column C when the value in column A is either Smith or Jones:

=AVERAGE(IF((A2:A8="Smith")+(A2:A8="Jones"),C2:C8))

You can easily replace the AVERAGE function in these formulas with others such as MAX, MIN, or COUNT to perform similar calculations.

Contents:
1. Arrays of Light






JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM eBook: Planning a Service Oriented Architecture
IBM eBook: Choosing the Right Architecture--What It Means for You and Your Business
Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
Avaya Article: Using Intelligent Presence to Create Smarter Business Applications
Intel Go Parallel Article: Getting Started with TBB on Windows
Microsoft Article: 7.0, Microsoft's Lucky Version?
Avaya Article: How to Feed Data into the Avaya Event Processor
IBM Article: Developing a Software Policy for Your Organization
Microsoft Article: Managing Virtual Machines with Microsoft System Center
Intel Go Parallel Article: Intel Threading Tools and OpenMP
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
HP Video: StorageWorks EVA4400 and Oracle
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Red Gate Download: SQL Toolbelt and free High-Performance SQL Code eBook
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
Silverlight 2 App and Walkthrough: Leverage Silverlight 2 with SQL Server and XML
IBM Article: Enterprise Search--Do You Know What's Out There?
HP Demo: StorageWorks EVA4400
Microsoft Article: The Progress and Promise of Deep Zoom
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES