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
Norton AntiVirus 2008

Most Popular Software Downloads
Ad-Aware 2008 Free
QuickTime for Windows
Windows XP Service Pack 3
Internet Explorer 7
Adobe Flash Player
Windows Live Suite
Mozilla Firefox 3.0 (Codename Gran Paradiso)
Paint Shop Pro
AVG Anti-Virus Free
Winamp

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
Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
Microsoft Article: 7.0, Microsoft's Lucky Version?
Microsoft Article: Hyper-V--The Killer Feature in Windows Server 2008
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Windows Server 2008
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
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
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
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
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES