#1   Report Post  
Rhonda
 
Posts: n/a
Default multiple lines

I have a master woksheet that I will type an item number into the sheet and
then I want to retrieve data from another worksheet. If I do a vlookup, it
will retrieve the line but my problem is on the worksheet it has multiple
lines. I need to know what formula to use.
Example:
Master Worksheet
(I enter the A1234 and the three lines appear)
A1234 This is a test
This is a big test
This is a small test
On the dataworksheet that I am pulling the info from:
A1234 This is a test
A1234 This is a big test
A1234 This is a small test
I would appreciate anyone's help.
Thanks


  #2   Report Post  
Domenic
 
Posts: n/a
Default

Assuming that A1:B1000 contains your data, and that the first row
contains your headers/labels, try the following...

C1: enter your criterion, such as A1234

D1: enter 0 (zero)

D2, copied down:

=IF((A2<"")*(A2=$C$1),LOOKUP(9.99999999999999E+30 7,$D$1:D1)+1,"")

E1:

=MAX(D:D)

F2, copied down:

=IF(ROW()-ROW($F$2)+1<=$E$1,MATCH(ROW()-ROW($F$2)+1,$D:$D,0),"")

G2, copied down:

=IF(N($F2),INDEX(B:B,$F2),"")

Hope this helps!

In article ,
Rhonda wrote:

I have a master woksheet that I will type an item number into the sheet and
then I want to retrieve data from another worksheet. If I do a vlookup, it
will retrieve the line but my problem is on the worksheet it has multiple
lines. I need to know what formula to use.
Example:
Master Worksheet
(I enter the A1234 and the three lines appear)
A1234 This is a test
This is a big test
This is a small test
On the dataworksheet that I am pulling the info from:
A1234 This is a test
A1234 This is a big test
A1234 This is a small test
I would appreciate anyone's help.
Thanks

  #3   Report Post  
Rhonda
 
Posts: n/a
Default

Let me try to explain it better because now I am lost.

Worksheet 1: Worksheet entry
Row A4


Worksheet 2: Database

A1=A1234 B1=Cold
A2=A1234 B2=Hot
A3=A1234 B3=Mild
A4=B789 B4= Red
A5=B789 B5= White

On Worksheet 1:
When I type A1234 in row A4
I want the following in B2, B3, B4,
B2=Cold (From Worksheet 2, B1)
B3=Hot (From Worksheet 2, B2)
B4=Mild (From Worksheet 2, B3)

On Worksheet 1:
When I type B789 in row A4
I want to see the following in B2, B3, B4,
B2=Red (From Worksheet 2, B4)
B3=White (From Worksheet 2, B5)

Do you know what I mean?




"Domenic" wrote:

Assuming that A1:B1000 contains your data, and that the first row
contains your headers/labels, try the following...

C1: enter your criterion, such as A1234

D1: enter 0 (zero)

D2, copied down:

=IF((A2<"")*(A2=$C$1),LOOKUP(9.99999999999999E+30 7,$D$1:D1)+1,"")

E1:

=MAX(D:D)

F2, copied down:

=IF(ROW()-ROW($F$2)+1<=$E$1,MATCH(ROW()-ROW($F$2)+1,$D:$D,0),"")

G2, copied down:

=IF(N($F2),INDEX(B:B,$F2),"")

Hope this helps!

In article ,
Rhonda wrote:

I have a master woksheet that I will type an item number into the sheet and
then I want to retrieve data from another worksheet. If I do a vlookup, it
will retrieve the line but my problem is on the worksheet it has multiple
lines. I need to know what formula to use.
Example:
Master Worksheet
(I enter the A1234 and the three lines appear)
A1234 This is a test
This is a big test
This is a small test
On the dataworksheet that I am pulling the info from:
A1234 This is a test
A1234 This is a big test
A1234 This is a small test
I would appreciate anyone's help.
Thanks


  #4   Report Post  
Domenic
 
Posts: n/a
Default

The solution I provided will do just that. However, it uses several
formulas to achieve what you want. It's a formula system I learned from
Aladin. It's very efficient, especially if you're dealing with a large
amount of data. But if you prefer, you can use the following single
formula instead...

Sheet1!B2, copied down:

=IF(ROWS(Sheet1!B$2:B2)<=COUNTIF(Sheet2!$A$1:$A$5, Sheet1!$A$4),INDEX(Shee
t2!B$1:B$5,SMALL(IF(Sheet2!$A$1:$A$5=Sheet1!$A$4,R OW(Sheet2!$A$1:$A$5)-RO
W(Sheet2!$A$1)+1),ROWS(Sheet1!B$2:B2))),"")

....confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

Hope this helps!

In article ,
Rhonda wrote:

Let me try to explain it better because now I am lost.

Worksheet 1: Worksheet entry
Row A4


Worksheet 2: Database

A1=A1234 B1=Cold
A2=A1234 B2=Hot
A3=A1234 B3=Mild
A4=B789 B4= Red
A5=B789 B5= White

On Worksheet 1:
When I type A1234 in row A4
I want the following in B2, B3, B4,
B2=Cold (From Worksheet 2, B1)
B3=Hot (From Worksheet 2, B2)
B4=Mild (From Worksheet 2, B3)

On Worksheet 1:
When I type B789 in row A4
I want to see the following in B2, B3, B4,
B2=Red (From Worksheet 2, B4)
B3=White (From Worksheet 2, B5)

Do you know what I mean?

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
Write code to insert multiple lines Frantic Excel-er Excel Discussion (Misc queries) 0 June 17th 05 12:13 AM
Multiple lines in 1 cell Zach F Excel Discussion (Misc queries) 2 April 14th 05 04:58 PM
Is there a way to delete multiple lines at the same time beside u. cherry Excel Discussion (Misc queries) 2 April 11th 05 06:21 PM
HOW CAN I TYPE MULTIPLE LINES IN A CELL brewster Setting up and Configuration of Excel 1 February 11th 05 11:46 AM
vlookup with multiple lines of same value lostinexcel Excel Worksheet Functions 1 December 17th 04 02:06 PM


All times are GMT +1. The time now is 02:50 PM.

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

About Us

"It's about Microsoft Excel"