tech on the net
Home About Us Feedback Site Map

Microsoft

Access Excel Word

Database

SQL Oracle / PLSQL SQL Server MySQL MariaDB PostgreSQL

Web Development

HTML CSS Color Picker

Language

C Language

More

ASCII Table Linux UNIX Java Clipart Joke of the Moment

Other Sites

CheckYourMath BigActivities DigMinecraft

Excel Functions

(Scroll to see more)

Share this page:

MS Excel: DGET Function (WS)

Learn how to use the Excel DGET function with syntax and examples.

Description

The Microsoft Excel DGET function retrieves from a database a single record that matches a given criteria. It is ia worksheet function (WS).

Syntax

The syntax for the Microsoft Excel DGET function is:

DGET( database, field, criteria )

Parameters or Arguments

database is the range of cells that you want to apply the criteria against.

field is the column to retrieve. You can either specify the numerical position of the column in the list or the column label in double quotation marks.

criteria is the range of cells that contains your criteria.

Note

  • If no record matches the criteria, the DGET function returns #VALUE! error.
  • If more than one record matches the criteria, the DGET function returns #NUM! error.

Applies To

The DGET function can be used in the following versions of Microsoft Excel:

  • Excel 2013, Excel 2011 for Mac, Excel 2010, Excel 2007, Excel 2003, Excel XP, Excel 2000

Type of Excel Function

The DGET function can be used in Microsoft Excel as the following type of function:

  • Worksheet function (WS)

Example (as Worksheet Function)

Let's look at some Excel DGET function examples and explore how to use the DGET function as a worksheet function in Microsoft Excel:

Microsoft Excel

Based on the spreadsheet above, the following Excel DGET examples would return:

=DGET(A4:D8, "Unit Cost", A1:A2) would return $3.50
=DGET(A4:D8, 3, A1:A2) would return $3.50
=DGET(A4:D8, 4, A1:A2) would return $7.00
=DGET(A4:D8, "Total Cost", C1:C2) would return #VALUE!

Using Named Ranges

You can also use a named range in the DGET function. For example, we've created a named range called orders that refers to Sheet1!$A$4:$D$8.

Microsoft Excel

Then we've entered the following data in Excel:

Microsoft Excel

Based on the spreadsheet above, the following Excel DGET examples would return:

=DGET(orders, "Total Cost", A1:A2) would return $7.00
=DGET(orders, 4, A1:A2) would return $7.00

To view named ranges: Under the Insert menu, select Name > Define.

Microsoft Excel