473,796 Members | 2,520 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 21236
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.newsgroup s.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:(S core/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

qryStudentScore s
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
2463
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 B 16-25 C over 25 X In Excel this is easy using a vlookup with its bin system
2
494
by: Rebecca | last post by:
could someone tell me the correct syntax for using vlookup in visual basic
5
17641
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 same thing as a FULL OUTER JOIN if you are familiar with sql. I tried to do this is in access, but access does not support full joins. Anyhow: I have two email lists, one woth 2500 entries, one with 2600. They are located in same worksheet, one in...
3
1803
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 a webpage. The main problem is the fact that I don't have a CLUE how to perform the lookup in Access. Basically we have 3 sheets. 1) where you enter your postcode and radius to search by, 2) a list of suppliers, their addresses and postcodes ... with...
4
19989
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
1
6794
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 you to look up the next smallest value to what you provided, and return any corresponding field from the table. Very useful for looking up things like currency exchange rates, tax rates, etc., where there might not be an entry for every day/income...
9
3637
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 access. For a user mismatch, it should give NA Thx.
0
1081
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 = Sheets("Product Code").Columns("A:D") col = 4 'On Error Resume Next ProductType = Application.VLookup(productcode, mg, col, 0) this code works fine most of the time however every once in a while it skips. and that is the reason why i...
0
1304
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 issue is vlookup function works only when i manually enter the values in the exported worksheet and click "Enter" button. Is there any way to invoke vlookup function from my .NET application. I have tried SendKeys.Send("{ENTER}"), however, it doesn't...
0
9680
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9528
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10456
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10230
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10174
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10012
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5442
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5575
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.