ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Database function criteria (https://www.excelbanter.com/excel-worksheet-functions/97714-database-function-criteria.html)

Maistrye

Database function criteria
 

Hi,

Essentially, I would like to be able to specify the criteria inside the
formulae DGET, DSUM, etc. as opposed to referencing cells elsewhere in
the spreadsheet. I'll give a bit of an example (and yes, I know for
this example there are other convenient ways to do it, that's not the
point):

Limitations:
- No VBA (can't be guaranteed others will turn on macros)

Database: Let it be called "db" for reference below.
Key Value
A 5
B 6
C 7

List:
Key OtherInfo Value
A Something [Formula]
A Whatever [Formula]
B YetMore [Formula]

Where the [Formula] is = DGET(db, "Value", [Criteria])
Where the [Criteria] is generated based on the key value in the current
row. ie. for the first row in the List, it would be Key = A, and so
on.

So, is there any way to assemble the criteria inside the formula? And
if so, how?

Thanks,
Scott


--
Maistrye
------------------------------------------------------------------------
Maistrye's Profile: http://www.excelforum.com/member.php...o&userid=36078
View this thread: http://www.excelforum.com/showthread...hreadid=558659



All times are GMT +1. The time now is 04:34 PM.

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