Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Exact Matches with DSUM.

Exact Matches with DSUM

Written by Allen Wyatt (last updated October 15, 2020)
This tip applies to Excel 97, 2000, 2002, and 2003


1

Dave has a list of sales figures for some items that have similar part numbers. He uses DSUM to analyze the number of units shipped, based on the part number. For example, he may have part numbers such as ABC01, ABC01A, ABC01M, IFA01 and IFM01. When Dave uses DSUM to match a part number such as ABC01A, it works great. However, if he wants to do an analysis of part number ABC01, DSUM includes in its sum not only ABC01, but also ABC01A and ABC01M. Dave wonders how he can get DSUM to return the correct totals for exact matches only on the part number.

When using DSUM, you need to be very careful with how you enter your criteria. For instance, let's say you enter ABC01 in the criteria table. Do this, and you'll get what you've noticed: DSUM matches all part numbers that begin with those five characters.

The solution is to enter your criteria in this manner:

="=ABC01"

Note the two equal signs in what you enter. The first one tells Excel to accept, as a literal, what follows in the quote marks. (It is, essentially, a formula you are entering.) When entered this way, the DSUM function matches only those part numbers that are exactly ABC01.

Interestingly, neither of the following works as a criteria:

="ABC01"
=ABC01

Of course, if all you want to do is figure out how many units of a particular part number were shipped, you might consider using the SUMIF function instead of DSUM. It only makes sense to use DSUM when you have multiple criteria you want to check in your analysis. The SUMIF function doesn't have the same strict requirements on entering criteria.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10590) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Exact Matches with DSUM.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Maintaining Leading Zeroes

When merging ZIP Codes from a data source such as Excel, you might find that Word ends up dropping out leading zeroes in ...

Discover More

Changing to the Right Thesaurus

Ever want Word to display a thesaurus for your country's version of English? This tip explains how to find the different ...

Discover More

Rounding in a Mail Merge

Word allows you to merge information into a document from various sources such as an Excel worksheet. If you do, you may ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (menu)

Indirect References to a DSUM Parameter

Indirect references can be very helpful in formulas, but getting your head around how they work can sometimes be ...

Discover More

Counting Records Matching Multiple Criteria

Excel provides worksheet functions that make it easy to count things. What if you want to count records that match more ...

Discover More

Inserting Large Numbers of Checkboxes

Excel provides a number of tools you can use to help create forms. One of those tools is a checkbox. If you need to place ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 1 + 1?

2016-04-09 06:51:36

Mike

Hi, can the ="=ABC01" format be used in other formula to get an exact result when searching?
Mike


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.