By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,154 Members | 2,313 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,154 IT Pros & Developers. It's quick & easy.

Lookup table between two ranges

P: n/a
Hi,

I would like to lookup a value (entered in cell D1) in the table
below. For example if it were between 0 and 2 it would return R1, if
it were between 3 and 5 it would return R2, etc.

(starting in column A1)
0 2 R1
3 5 R2
6 8 R3

Any help would be gratefully received
Dec 5 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"LROCCO" <l_*******@yahoo.co.ukwrote in message
news:f1**********************************@s19g2000 prg.googlegroups.com...
Hi,

I would like to lookup a value (entered in cell D1) in the table
below. For example if it were between 0 and 2 it would return R1, if
it were between 3 and 5 it would return R2, etc.

(starting in column A1)
0 2 R1
3 5 R2
6 8 R3

Any help would be gratefully received
Use an IIF statement in a query (untested):

Iif([MyField] between 0 and 2, "R1", Iif([MyField] between 3 and 5, "R2",
"R3")))

Don't store calculated fields in tables!

Keith.
www.keithwilby.com

Dec 5 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.