ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Database Lookup (https://www.excelbanter.com/excel-worksheet-functions/8210-database-lookup.html)

Raymond Gallegos

Database Lookup
 
is there a way to match TWO fields in a database and return a value from
one of the columns in the database?

RagDyer

If I understand your question:

Database - A1:C100

Match record in Column A to contents of D1
Match record in Column B to contents of D2
And return contents of corresponding record (row) from Column C

For numeric data:
=SUMPRODUCT((A1:A100=D1)*(B1:B100=D2)*C1:C100)

For alpha data:
=INDEX(C1:C100,MATCH(1,(A1:A100=D1)*(B1:B100=D2),0 ))
Above formula must be entered as an array formula with CSE (<Ctrl <Shift
<Enter), instead of just hitting <Enter.
This will *automatically* enclose the formula in curly brackets, denoting an
array formula, and *cannot* be done manually.
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


"Raymond Gallegos" <Raymond wrote in
message ...
is there a way to match TWO fields in a database and return a value from
one of the columns in the database?



All times are GMT +1. The time now is 02:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com