DLookUp function and a range

jex57

Board Regular
Joined
Oct 29, 2015
Messages
62
Hi
I am trying to use a Dlookup with a range:

=DLookUp("[Symbol]","[Grade]","[Grade (%)] >= [Grade]![Grade_min] AND [Grade (%)] <= [Grade]![Grade_max]")


No matter what my grade (%) I always get the lowest value - it does not seem to look up the range.

Any ideas?

Thank you
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
with a range:
Is this an Excel question, because you posted in the Access part of the forum? If not, then what is Grade! and Grade_max - form and control references?
If so, try this format (assuming the criteria being passed are numbers)
"[Grade (%)] >= " & Forms![Grade]![Grade_min] & " AND [Grade (%)] <= " & Forms![Grade]![Grade_max])
 
Upvote 0
Is this an Excel question, because you posted in the Access part of the forum?
I am pretty certain it is an Access question (which means it is posted in the correct place).
DLOOKUP is an Access function (Excel does not have a DLOOKUP function).
 
Upvote 0
Was not sure, because Access doesn't have a "range" either, but I am not as familiar with Excel functions as I am with Access.
Thanks.
P.S. - do you think my answer is on the right track? I ask because I think you are pretty good with Access...
 
Upvote 0
P.S. - do you think my answer is on the right track? I ask because I think you are pretty good with Access...
Yes, at first casual glance your formula looks pretty good to me.

I think maybe the confusion is in the word "range". I don't think that they are talking about a "range of cells", like we use in Excel, but rather a "numerical range" (where they are looking for records between a low and high value they are specifying).

I also think there is some ambiguity with the question. I cannot tell if they are expecting more than one record to be returned, which would be problematic, because DLOOKUP only returns a single value.

jex57,
It may be helpful if you could just explain in English exactly what you are looking for, and maybe provide a small sample of data and your expected results.
 
Upvote 0

Forum statistics

Threads
1,221,831
Messages
6,162,250
Members
451,757
Latest member
iours

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top