473,395 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to vlookup in Access

I am trying to come up with a way to lookup values in Access as easily as I
can in Excel.

My application is looking up scores. An example lookup table below explains
what I'm after:
TABLE1
Measure (pct) Number score Letter grade Disposition
1% 40 A
Pass
6% 36 B
Pass
10% 32 C
Marginal
Substd
Fail- HOLD

In Excel it is simple. I evaluate a measure say 7%
Excel looks down the table and stops at the 6% line since7% is larger than
6% but smaller than 10%
Excel returns 32 or C or Marginal depending on which place I specify

Example (vlookup(0.07, TABLE1,3) yields a "C" vlookup(0.07, TABLE1,4) yields
"Marginal"

How can I accomplish the same end in Access without getting into
programming?

Thanks for your help
Fred


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Nov 12 '05 #1
3 21219
Create a table that stores this info and you can create any query you want
to
act against it. No code necessary. Example structure might be...

FieldName DataType
---------------------------------
Measure Number (format as percent)
Score Number (Integer or Long)
Grade Text
Disposition Text

Any any other fields you may need.

Mike Storr
www.veraccess.com
"Fred" <fr**************@wymans.com> wrote in message
news:40********@corp.newsgroups.com...
I am trying to come up with a way to lookup values in Access as easily as I can in Excel.

My application is looking up scores. An example lookup table below explains what I'm after:
TABLE1
Measure (pct) Number score Letter grade Disposition
1% 40 A
Pass
6% 36 B
Pass
10% 32 C
Marginal
Substd
Fail- HOLD


Nov 12 '05 #2
Very simple. You create two tables and 2 queries. I will assume you
are grading students for this explanation. tblStudent contains Student
Information. tblScores contains grading information.

tblScores
ScorePrecent Grade
100 A
99 A
... A
90 A
89 B
88 B
... B
80 B
...

tblStudent
Name Score Total
smith 40 50
jones 38 50
Lee 49 50
...

For calculating the ScorePercent of each student create a query based on
the student table. In the student query, ScorePerent would be a
calculated field which you would include like this:

Name Score Total ScorePercent:(Score/Total) * 100

name this query qryStudentInfo

Now create a 2nd query where you join qryStudentInfo with tblScores on
the common field of ScorePercent which is a unique field in tblScores.
In this query you include the Grade field from tblScores. Now your
query table looks like this

qryStudentScores
Name Score Total ScorePercent Grade
smith 40 50 80 B
jones 38 50 76 C
...
Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3
Fred wrote:
I am trying to come up with a way to lookup values in Access as easily as I
can in Excel.

My application is looking up scores. An example lookup table below explains
what I'm after:
TABLE1
Measure (pct) Number score Letter grade Disposition
1% 40 A
Pass
6% 36 B
Pass
10% 32 C
Marginal
Substd
Fail- HOLD

In Excel it is simple. I evaluate a measure say 7%
Excel looks down the table and stops at the 6% line since7% is larger than
6% but smaller than 10%
Excel returns 32 or C or Marginal depending on which place I specify

Example (vlookup(0.07, TABLE1,3) yields a "C" vlookup(0.07, TABLE1,4) yields
"Marginal"

How can I accomplish the same end in Access without getting into
programming?


You can't. Anything is programming here. ;-) But this kind of 'program'
is called a query. I think its SQL looks somewhat like

select top 1 [number score] from table1 where measure>=7 order by measure

--
Bas Cost Budde
http://www.heuveltop.org/BasCB
but the domain is nl

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Fred | last post by:
I have an application that involves calculating a score based on a number of defects. Simplified example of the scoring: No_Defects Score 1-3 A 4-15 ...
2
by: Rebecca | last post by:
could someone tell me the correct syntax for using vlookup in visual basic
5
by: catlover30 | last post by:
HI, I need help with excel VLOOKUP! I am at a new job and really trying to solve this without asking anyone at work, since they seem th expect me to know this. What I am trying to acheive is the...
3
by: Widge | last post by:
I have made a spreadsheet that will calculate the distance from a set of addresses to a specified postcode in Excel. I'm looking to move this to Access so I can start thinking about hooking it up to...
4
by: ritheshtitu1982 | last post by:
Hi, I would like to perform Vlookup in access. Eg. I have two Tables Code table Code --- No { ------- 0 ...
1
by: scubasteve | last post by:
Looking up values from an Access table is simple. Simulating the 'Range Lookup' functionality from Excel's VLookup formula is a bit trickier. For those that aren't familiar with this, it allows...
9
by: Sinner | last post by:
Hi, I have a field name 'USER' in tableMAIN. How do I replace the user names with corresponding user names. I can do that in xl using vlookup but now I'm trying to find a way to do that in...
0
by: loudey | last post by:
I'm using Vlookup to lookup a "Product Type" in Column "D" vs a given "Product Code" that is listed in Column A. here is the code that I'm using, 'Product Type lookup Set mg =...
0
by: Balaji Gurunathan | last post by:
Hi All, I am exporting a datatable to an excel sheet in an existing workbook. In another worksheet in the same workbook, i am using vlookup function that uses data in the exported worksheet. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.