Hello,
I'm not sure if this is exactly a programming question or if there's a combination of functions I'd need to use, but I think the question is straightforward and simple enough that I should be able to use Excel. I don't mind having to stir up access if need be, but I hope what I want to do is simple enough that I could just use some simple queries.
Assume I have a set of data, say the characteristics of products:
id criteria 1 criteria 2 cost
1 1 4 0.93
2 2 3 1.43
3 4 8 2.75
4 8 12 3.93
5 15 13 4.33
6 20 15 5.72
And I then I want to populate the below table with id's from above, where the header on top (criteria 1) and the header on the left (criteria 2) are both exceded for the smallest price, and the inside of the below table is populated.
1 4 7 15
1 ? ? ? ?
4 ? ? ? ?
8 ? ? ? ?
12 ? ? ? ?
16 ? ? ? ?
What I know:
I could easily do this with an SQL statement like this:
SELECT id FROM table WHERE criteria_1 > input1 AND criteria_2 > input2 ORDER BY price LIMIT 1
However, there's no such thing as LIMIT (frustrating!), and I end up using things like TOP 1 instead... I feel like maybe I am doing poor practices.
If I could set input1 and input2 to be a cell where I could drag and copy along, this would be no problem.
However, I am finding myself using access and creating databases, creating parameterized variables, and that while you can set single query with a given parameter to take the parameter values out of cells, you can not just drag those cells and have them copy the relative cell stuff. If you want to have multiple parameter cells, it appears you need unique queries! YIKES if I have a 10 x 10 box to fill.
I feel like I am making this WAY more complicated than I need to...
I'm definitely a self-learner and I don't want to have someone write up the spreadsheet for me, I feel like maybe I'm making this way more complicated that I need to.
Any help would be appreciated!
thanks in advance,
Matt
Bookmarks