Introduction to Excel - Top-5 Functions

Posted Fri, Jun 26 2009 19:03 by Nate Oliver

Top-5 Primer Worksheet Functions 

Excel’s a robust and dynamic piece of software offering a variety of capabilities. Today we will discuss the most common use of Excel, an analytical tool with given data sets and 5 must-know, general usage Worksheet Functions to begin to work with Excel. These 5 Worksheet Functions include Sum(), Count(), SumIf(), CountIf() and VLookup().

 Sum()

Sum() allows one to add values in a variety of manners. The most common use would be to sum a given, contiguous range, e.g., =Sum(A1:D10), the result being every cell in A1 through D10 being added together.

Sum() also allows for arguments via the use of a comma, which allows for multiple, non-contiguous ranges to be added. Two differing examples would include both single-cell, non-contiguous ranges, e.g., =Sum(A1,D1,F1) and multi-cell, non-contiguous ranges, e.g., =Sum(A1:A5,C1:C5,E1:E5).

One thing to note with Sum() is that it does not ignore error values in your data, e.g., if you have 1,000 valid cells of data and a single cell in the calculation range contains an error (e.g., DIV/0 – division by 0), Sum() will not return the sum of the range, but the error, DIV/0. This behavior is by design, to alert you that there is a potential issue with your data. However, later we will explore a simple work-around (see SumIf()).

Count()

Count() allows one to gather a count numeric data in their spreadsheet. As with the previously discussed Sum() function, Count() can work with single ranges, non-contiguous ranges and multi-cell ranges - the latter with comma-separated arguments.

SumIf()

Sum() works great if you want to add everything in sight, but what if we want to add values based on a specific criteria?

Enter SumIf(), which will sum a given range of values, if a given criteria is met. In pseudo code, SumIf() reads as =SumIf(Range of Criteria Values, Your Criteria, Range to be Summed). The last argument, separated by commas, is optional – if omitted, the Range of Criteria Values is summed.

Note that SumIf() supports wildcard characters and mathematical operators, as mentioned  here:

http://office.microsoft.com/en-us/excel/HP052092921033.aspx?pid=CH062528291033

As promised, a quick and risk-free work-around to summing ranges that house error values within its cells. It’s not recommended that Excel users allow error values to flow through their spreadsheets; however, it is imaginable that an individual has a pressing engagement, say a tee-time, and needs to provide a colleague a sum of data that houses errors, much sooner than later.

SumIf() allows one to do this by invoking a simple mathematical operator, which forces SumIf() to ignore all non-numeric data, of any sort, including error values. So, the following transaction is risk-free: =SUMIF(A1:A10,"<=9.99999999999999E+307")

The reason that this transaction is risk-free is that 9.99999999999999E+307 is the largest number allowable in Excel (see the help file on “Limitations”), so all functional numbers in Excel must either equal or be less than this number, and only numeric cell entries will be considered at this point.

Be careful with 9.99999999999999E+307, there’s a reason I’m burying it in quotes, Excel can do strange things with numbers, due to its Data Types – a subject for another day.

CountIf()

Like SumIf(), CountIf() provides us with a manner of conditional counting. The slight variance is that it takes two arguments, the range you want to evaluate and the criteria to evaluate that range by, e.g., =CountIf(Range you want to count, Criteria to be met).

CountIf() also supports wildcard characters and mathematical operators, as should be noted, here:

http://office.microsoft.com/en-us/excel/HP052090291033.aspx?pid=CH062528311033

VLookup()

VLookup() is an extremely useful worksheet function, in Excel, and chances are if you’re interviewing for a job that requires somewhat advanced Excel experience, you will be asked about it. While we won’t cover the several underlying algorithms, let’s have a look at really understanding the implementation.

Most of Excel’s worksheet functions are designed with names that are memorable, in an English-sense, and VLookup() is no exception, in layman’s terms, it is short for “Vertical Lookup”. This function performs a search on a column of values, a column being vertical, and if said value is found, offsets a number of specified columns, and returns a corresponding value.

Before using, I recommend reviewing the help file for this function, as well:

http://office.microsoft.com/en-us/excel/HP052093351033.aspx?pid=CH062528281033

So what does this mean? First of all, pretend you don’t know the last argument, for now, let’s stick with False. Here in pseudo code is what this means:

=VLOOKUP(Value to Find, Range of Values – Including the Offset Range, Number of Columns to Offset from first Column, False - for now)

The left-most column of the 2nd argument refers to the column you’re actually searching, and the right-most isn’t what this is limited to, but is generally recommended to be - the farthest column you want to offset to, to return your value. So, if you want to return a value from column B, that is dependant on a match from column A, the example could look something like this:

=VLOOKUP("August",A1:B12,2,FALSE)

Where 2 indicates to return a value in the 2nd column of the specified Range of values.

Returning to the 4th argument of VLookup() and the True argument. This can be more efficient due to the manner in which the underlying algorithm processes. But, as noted in the help file, your first column has to be sorted in ascending order for it to be trustworthy, due to a difference in the way it searches.

Conclusion

There are quite a few of differing, very useful worksheet functions in Excel, and most of them are well documented. This is a quick-hit list of some that might prove to be more frequently used and useful for general purposes.

Comments

# re: Introduction to Excel - Top-5 Functions

Saturday, June 27, 2009 2:21 AM by sam

For me its

1) IF

2) SUMPRODUCT (Which can do  SUM, SUMIF, SUMIFS, COUNT, COUNTIFS, VLOOKUP -to some extent)

3) MATCH/INDEX - Which can do everything that Vlookup/Hlookup can and lots more. It also removes limitation of Vlookup/Hlookup

4) Count/Counta/Large/Small

Sumproduct cant handle errors between data

However SumIF(s) and CountIF(s) cant distinguish between beyond 15 digit in a number with 16 digits (stored as text)

Eg; Credit card number where the 1st 15 digits are same.

# re: Introduction to Excel - Top-5 Functions

Saturday, June 27, 2009 11:54 AM by Nate Oliver

Hi Sam,

I think the list you're providing, while solid, differs from my intent. SumProduct() is far and away my favorite Worksheet Function, because it's so versatile.

However the intent of this blog entry is to simply introduce Excel to someone who hasn't used it - in terms of 5 Worksheet Functions.

While I agree that Index(Match()) is much more robust than VLookup(), I'd recommend learning how to use VLookup() before learning that combination.

# re: Introduction to Excel - Top-5 Functions

Saturday, June 27, 2009 12:21 PM by Nate Oliver

Keep in mind, this list is fairly arbitrary, because I made it up - in good faith.

Said list could easily include Min(), Max(), Round(), Average(), etc... As I said, there's a lot of useful Worksheet Functions in Excel.

For this particular entry, I simply had to start and stop somewhere - and I wanted to write some content for someone starting out with Excel.

It is my intention to cover more advanced Worksheet Functions in future blog entries.

# re: Introduction to Excel - Top-5 Functions

Sunday, June 28, 2009 11:42 AM by Debra Dalgleish

Nate, you're right -- this list is a good start for someone new to Excel functions. Once you understand these five, it's easy to figure out how some of the other, similar, functions work.

# re: Introduction to Excel - Top-5 Functions

Monday, June 29, 2009 10:17 AM by Ken Puls

It astounds me when I teach how many "intermediate" users have never used a vlookup.

Personally, the top three formulas that I would teach a new user out of the gate are SUM, ROUND, IF.  Add Count to that list and they can achieve SUMIF and COUNTIF with the use of helper columns.

# re: Introduction to Excel - Top-5 Functions

Monday, June 29, 2009 12:23 PM by Nate Oliver

Thanks for the vote of confidence, Debra!

Ken, you make a great point, and If() is probably a glaring omission due to its usefulness, in general.

# re: Introduction to Excel - Top-5 Functions

Thursday, July 02, 2009 4:32 PM by fzz

If you're going to include SUM and COUNT, basic descriptive statistics, you should include AVERAGE, MIN and MAX.

VLOOKUP is more of an intermediate function.

COUNTIF and SUMIF have too many gotchas to be appropriate for beginners. Just look at all the newsgroup questions they generate.

So I guess that means my basic 5 would be SUM, COUNT, AVERAGE, MIN and MAX. I might extend this to 8 (per Ken Puls) with IF, ROUND and INT - can't have ROUND without INT.

# re: Introduction to Excel - Top-5 Functions

Thursday, July 02, 2009 7:59 PM by Nate Oliver

Hi fzz, I see you're not as forgiving as I am, e.g.,

msmvps.com/.../online-excel-resources.aspx

"When you make a list like this, given the vast amount of high-quality Excel resources on the Internet, you're going to get it a little right, and probably a little wrong..."

There's a lot of Worksheet Functions - to pick only 5 is kind of tricky. I probably got this a little bit right, and a little bit wrong.

And keep in mind, we're not all insurance actuary's in a Chicago suburb.

While I might agree that VLookup() is more intermediate than Int() or Round(), it could easily prove to be more useful to a lot more people. You seem confident that your opinion is pretty much beyond reproach. Why is that?

It comes back to what Debra said, not to put words in her mouth. If you learn these five, the next five become a lot simpler.

At least we all agree that Sum() is where you start?

# re: Introduction to Excel - Top-5 Functions

Friday, July 03, 2009 5:10 AM by fzz

Forgiving?

I don't claim my opinion is the one true way, but VLOOKUP really isn't for beginners. It may prove useful for small tables, but once tables extend past 10 or so columns, the potential for errors in the 3rd argument begin to grow exponentially. Experience teaches those few who become proficient Excel users that

=INDEX(DF3:DF1002,MATCH(x,A3:A2002,0))

is less prone to error than

=VLOOKUP(x,A3:DZ1002,110,0)

The latter is more compact, but that 110 as 3rd argument is one of those 'magic' numbers that should be avoided if possible.

One way around this is using distinct column headings, then using MATCH against these column headings to determine the column, e.g.,

=VLOOKUP(x,A3:DZ1002,MATCH(f,A2:DZ2,0),0)

but at that point why not use

=INDEX(A3,DZ1002,MATCH(x,A3:A1002,0),MATCH(f,A2:DZ2,0))

which makes some ex-123 users nostalgic for

@XINDEX(A2:DZ1002,f,x)

The problem with VLOOKUP, SUMIF and COUNTIF is that not long after one becomes comfortable using them, one discovers their shortcomings and has to move on to INDEX(.,MATCH()) and SUMPRODUCT. Why waste time on these intermediate steps rather than go directly to robust formula idioms?

# re: Introduction to Excel - Top-5 Functions

Friday, July 03, 2009 10:28 AM by Nate Oliver

Apologies, I edited your comment to remove the all-caps. When I requested no more all-caps comments, what I meant was no more all-caps comments, please.

It's too loud, we can all read what you're saying without it, and I don't want to scare off potential readers/comments with such loudness. You wouldn't send a colleague an email as such, would you?

Okay, so you're teaching a 14-year old who has never used Excel before, and you're saying VLookup() is too over-the-top? I guess I just don't agree. Grid, lookup, offset.

But, I wouldn't jump straight into SumProduct() and Index(Match()) functions, these simply come after, imo. Wasting time? I believe you need to learn to crawl before you walk, and walk before you run the marathon.

# re: Introduction to Excel - Top-5 Functions

Sunday, July 05, 2009 9:49 PM by fzz

I have taught 14 year-olds (my kids - actually when they were younger than that) how to use spreadsheets for charting (OpenOffice Calc rather than Excel). Some calculations involved, but no need for VLOOKUP.

What noncontrived VLOOKUP uses have you found that would be of any interest or practical value to 14 year-olds?

SUMPRODUCT does everything SUMIF and COUNTIF can do and a lot more. I don't use SUMIF and COUNTIF, so it'd be just a bit hypocritical to teach them.

# re: Introduction to Excel - Top-5 Functions

Monday, July 06, 2009 11:42 AM by Nate Oliver

So, the request is a contrived, non-contrived, example?

Well, I'd have to guess that a 14-year old would use VLookup() for the same reason as anyone, to extract data from a given list. If you're asking for a context? Perhaps sports statistics of some sort? A player's career, team statistics, a fantasy league, their own stats, etc... This is only one context, and is only limited by the imagination.

I use SumIf() and CountIf() all the time, they're more efficient than SumProduct() when it comes to conditional calculation with respect to a single condition. Using SumProduct() in these cases is akin to hunting mice with an elephant gun - it works, but, I think I'd proceed with something a little less heavy-duty.

There's an extreme example of this, here:

www.decisionmodels.com/optspeedk.htm

A musical outfit, Men At Work, wrote a song about this; it's called 'Overkill'. It's a good song, if you haven't heard it, I recommend you check it out.

# re: Introduction to Excel - Top-5 Functions

Monday, July 06, 2009 4:07 PM by fzz

From my previous response with CAPS since you seem to need emphasis: What NONcontrived VLOOKUP uses have you found that would be of any interest or practical value to 14 year-olds?

As for your lookup example, nice try. I've already shown my 2 older kids how to use OpenOffice Base to store and retrieve tabular data. If lookups provide final results, databases are more appropriate than spreadsheets. Or should I be teaching them how to use hammers to drive screws?

Apparently your imagination isn't sufficient to come up with an example more relevant to spreadsheets than databases.

Yes SUMIF and COUNTIF can plow through lots of cells more efficiently than SUMPRODUCT, but databases can run through lots of data while SUMIF and COUNTIF would shuffle and SUMPRODUCT would crawl. For little data, SUMPRODUCT's greater flexibility usually makes it a better choice despite its slowness. For lots of data, better to keep it in databases and use database queries to produce conditional summaries. That's definitely into advanced territory.

For interactive use, filters, outlining, subtotals and pivot tables eliminate the need for lookups. Lookups are mostly needed in formula-driven, less interactive models, and those usually aren't produced by spreadsheet beginners.

# re: Introduction to Excel - Top-5 Functions

Monday, July 06, 2009 6:16 PM by Nate Oliver

I don't need emphasis - what might be better is for you and I to sit down and have a happy hour. It's Shaumburg, right?

I think you're getting a little carried away, a 14-year old shouldn't have to go out and buy Office Professional, or Oracle, or SAP, to manage some stats. Nor should my mother.

At the same time, I concede, this is a very database-like function - one that's used a lot. No one said lots of data, take the following:

www.pro-football-reference.com/.../MillKe00.htm

That's not a lot of data.

Is it your contention that a 14-year might not want to cut something like that, in Excel? I'd say your imagination is lacking - I have cut this kind of data, in Excel, before.

Why would I set up a SQL Server to cut that? Allow me - you wouldn't.

You don't need all caps - we can all read what you're typing.

# re: Introduction to Excel - Top-5 Functions

Tuesday, July 07, 2009 8:53 PM by Sven

As a 14 year old, I just wanted to say I'm getting a kick out of this.

# re: Introduction to Excel - Top-5 Functions

Wednesday, October 21, 2009 5:49 PM by LilA

I'm gonna go with Nate here and agree with SUMIF and COUNTIF versus SUMPRODUCT.  Those are both very simple functions and yet get plenty of usage.

Personally, I use VLOOKUP all the time and it's widely used where I work.

Explaining VLOOKUP to someone is far far easier than INDEX/MATCH.

Generally when users need more advanced functions, they pass the request on to a superuser.  When you have users that use a CALCULATOR to do the math and then manually enter the results into Excel so the numbers line up all nice and pretty, about the extent of "stretching" you're going to achieve is SUM or other basics like that.

Leave a Comment

(required) 
(required) 
(optional)
(required)