Wikiposts
Search
Computer/Internet Issues & Troubleshooting Anyone with questions about the terribly complex world of computers or the internet should try here. NOT FOR REPORTING ISSUES WITH PPRuNe FORUMS! Please use the subforum "PPRuNe Problems or Queries."

Excel Question

Thread Tools
 
Search this Thread
 
Old 14th Sep 2005, 11:27
  #1 (permalink)  
Thread Starter
 
Join Date: Feb 2003
Location: Io
Posts: 420
Likes: 0
Received 0 Likes on 0 Posts
Excel Question

I am working on an excel spreadsheet where I have a range of headings:

Order no: Date In: Type: Qty: Date Out: Price: Per unit: Total:

I have a seperate worksheet with a list of products by Type: Description: Price:

Is there an easy way to enter a type number into the first sheet and then Excel to automatically look at the other worksheet and pull out the description and price?

Hope this makes some sort of sense.

Thanks in advance.

MF
Maxflyer is offline  
Old 14th Sep 2005, 12:03
  #2 (permalink)  
 
Join Date: Mar 2003
Location: England
Posts: 286
Likes: 0
Received 0 Likes on 0 Posts
Hi MF,

1. This answer depends on the type number being unique.

2. When you say separate Worksheet, I am assuming a different worksheet within the same workbook.

If so, then:

Sheet 1 has:

--A----------B-------------C
Type: Description: Price:

Select column A, then click Insert, Name, Define,

In the Names in workbook: box enter: Type

The Refers to: box should contain =Sheet1!$A:$A.

Click Add.

Click Close.

Select column B repeat the above entering Description in the Names in workbook box.
Select column C repeat the above entering Price in the Names in workbook box.

Populate the above table with your type description and price data.

Save the workbook!

Sheet 2 has:

A--------------B---------C-----D-------E----------F--------G--------H
Order no: Date In: Type: Qty: Date Out: Price: Per unit: Total:


Assuming Row 2 is the first row with data, enter this formula in cell F2:

=IF(A2="","", INDEX(Price,MATCH(C2,Type,0),1))

Then copy the formula down.

You do not have a column for the description in your example, but the formula for that column is:

=IF(A2="","", INDEX(Description,MATCH(C2,Type,0),1))

Hope this helps

EG
ExGrunt is offline  
Old 17th Sep 2005, 08:32
  #3 (permalink)  
ανώνυμος
 
Join Date: Feb 2004
Location: Perth
Posts: 111
Likes: 0
Received 0 Likes on 0 Posts
Wouldn't the Vlookup command be a simple way of doing this?
R4+Z is offline  
Old 17th Sep 2005, 19:19
  #4 (permalink)  

Official PPRuNe Chaplain
 
Join Date: Apr 2001
Location: Witnesham, Suffolk
Age: 80
Posts: 3,498
Likes: 0
Received 0 Likes on 0 Posts
Sounds like a candidate for one of the LOOKUP functions, for sure. I've got a few spreadsheets here that do just that.
Keef is offline  
Old 19th Sep 2005, 12:25
  #5 (permalink)  
 
Join Date: Mar 2003
Location: England
Posts: 286
Likes: 0
Received 0 Likes on 0 Posts
@MF

I assume you received the example I sent to you OK.

@R4+Z

Yes, you can use VLOOKUP, However for business applications it is less robust than the above approach.

Try this example:

In cells A1:A4 enter: 1,2,3,4
In cells B1:B4 enter: a,b,c,d
In cells C1:C4 enter: e,f,g,h

In Cell A5 enter: Look up Value
In Cell A6 enter: 3

In Cell A7 enter: Result
In Cell A8 enter: =VLOOKUP(A6,A1:C4,3)

Cell A8 evalutes to: g

Circumstances change, so you need to add another column.
Select column B, then click Insert, Columns

You will see that cell A8 is now =VLOOKUP(A6,A1:D4,3) and evaluates to c

This occurs because the 3 in =VLOOKUP(A6,A1:D4,3) is an absolute reference to the columns in A1:D4 and does not get updated.

It is an insidious error and easily missed. Why risk it?

EG
ExGrunt is offline  
Old 19th Sep 2005, 12:42
  #6 (permalink)  
Thread Starter
 
Join Date: Feb 2003
Location: Io
Posts: 420
Likes: 0
Received 0 Likes on 0 Posts
EG. Thanks for that. I am using the example you originally sent.

Thanks also to Keef and R4+Z (is that a formula I should use?)

Cheers

MF
Maxflyer is offline  

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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



Contact Us - Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service

Copyright © 2024 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.