Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel Lookups

I have a large table of data in which I need to populate a certain
row. Here is an example.
Master table
Price
Nuts
Nuts
Bolts
Bolts
Bolts
Screws
Screws

Price Table
Nuts 1.00
Bolts .50
Screws .25

The price column in the master table is empty and I would like to fill
it in by referencing the price table. Does anyone know how I could do
this? Thanks.
Rory
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Excel Lookups

Hi
use the following formula in cell B1 of your master sheet:
=VLOOKUP(A1,'price sheet'!$A$1:$B$20,2,0)
and copy this formula down

-----Original Message-----
I have a large table of data in which I need to populate

a certain
row. Here is an example.
Master table
Price
Nuts
Nuts
Bolts
Bolts
Bolts
Screws
Screws

Price Table
Nuts 1.00
Bolts .50
Screws .25

The price column in the master table is empty and I would

like to fill
it in by referencing the price table. Does anyone know

how I could do
this? Thanks.
Rory
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Excel Lookups

Rory,

I like using Named Ranges. I try to design my Tables in
Excel using the following rules

List/table is isolated from other data
List/table is contiguous (no empty columns/rows)
List/Table has ONE ROW of unique headings

Under these conditions I use the CurrentRegion Icon to
SELECT the entire list/table and then Insert/Name/Create-
Create names in TOP row.

I then use column range names in all my worksheet
formulas and in my VBA code.

Sub LoadMasterTable
Dim r as range, sItem as string, ptr as variant
Dim wsMaster as worksheet, wsPrice as worksheet
Set wsMaster = Sheets("Master Table")
Set wsPrice = Sheets("Price Table")
With wsMaster
For Each r in .Range(.Cells(2, 1), .Cells(2, 1).End
(xlDown))
With r
sItem = .Value
ptr = application.match(sItem, wsPrice .Range
("Price_Table_Item"),0)
If Not IsError(ptr) Then
.Offset(0, 1).Value = application.index(range
("Price_Table_Price"),ptr, 1)
End If
End with
Next
End With
End Sub

Now I have a question for you.

Why multiple rows per Item in your Master Table?

SkipVought

-----Original Message-----
I have a large table of data in which I need to populate

a certain
row. Here is an example.
Master table
Price
Nuts
Nuts
Bolts
Bolts
Bolts
Screws
Screws

Price Table
Nuts 1.00
Bolts .50
Screws .25

The price column in the master table is empty and I

would like to fill
it in by referencing the price table. Does anyone know

how I could do
this? Thanks.
Rory
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel Lookups

Thanks a bunch Frank! That works perfectly.
Rory
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel lookups should have a return paramater if not found LJ Excel Worksheet Functions 3 January 14th 10 05:14 PM
Lookups in Excel on Data from Access not working goldcd_2 Excel Worksheet Functions 2 January 31st 07 06:01 PM
Excel Formula for multiple lookups stephens176 Excel Discussion (Misc queries) 2 January 26th 07 07:33 PM
Excel Conditional sum, lookups and functions help PLEASE!! Billjary Excel Worksheet Functions 1 April 5th 06 12:40 AM
LOOKUPS - Creating LOOKUPs where two different values must BOTH be satisfied. Mr Wiffy Excel Worksheet Functions 2 May 16th 05 04:29 AM


All times are GMT +1. The time now is 05:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"