Using cell reference with logical operator in DGET expression

B

BoxleyFarm

I am using DGET to search an array in the worksheet to find a particular
percent to use in a calculation elsewhere in the spreadsheet. The row members
of the array contain a series of from and to values that I use to identify
which row has the percent I am looking for. I have defined the array as a
range and I can use the logical operatirs with numeric values in the range
criteria and everything works fine. For example, I can use <500 in the
appropriate cell in range criteria to find the percent to use when the value
for that column in the array is less than 500. All working fine. If, however,
I use a cell reference in the criteria range where the value I want to tet is
coming from, for example cell +V2 in the worksheet, the only logical operator
I seem to be able to use is =. For example, if I enter =V2 in the criteria
range, the DGET expression resolves properly. But if I enter <V2 or >V2 or
<=V2 or <=V2, I get a VALUE error. In order to resolve for the correct
percent I have to be able to test multiple criteria for "greater than" Col A
and "less than Col B, and so forth. And the values I am testing against are
coming from an import into the spreadsheet. So what I really need is the
ability to take an imported value which is located in a cell and configure
the range criteria to find the row in the array where that value fits between
the values in ColA and ColB, etc. Can this be done with DGet?
 
O

ozgrid.com

RE: But if I enter <V2 or >V2 or
<=V2 or <=V2, I get a VALUE erro

Use;

=">" & V2 etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top