Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
hgopp99
 
Posts: n/a
Default Retreive data from another worksheet based on multiple columns

I am trying to retreive a date from one worksheet and place it on another.
Most often, I can match on company name, but there are times when the company
name is not unique and I have to use first/last name. The following is an
example of data on the worksheet I am trying to retreive from:


Acutech 12/01/05 N Ms. Linda Dendy
Adams Simpson LLP 12/01/05 N Mr. Jesse Evans
Adams Simpson LLP 01/01/06 N Ms. Deborah Hembree

I am using the following: =INDEX(Misc!$A:$C,MATCH(C38,Misc!$A:$A,0),2).
This will work and find the match, pick the date (from the second column),
but in the case where the company is Adams Simpson LLP, it will always choose
the 12/01/05 date. I need to find both. So I would need to match on the
first and last name if there is more than one entry of the company.

Can this be done (simply)? Thank you.

--
hgopp99
--
hgopp99
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Retreive data from another worksheet based on multiple columns

You can use this kind of syntax:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)*(b2=othersheet !$b$1:$b$100),0))
(one cell)

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can't use the whole column.

hgopp99 wrote:

I am trying to retreive a date from one worksheet and place it on another.
Most often, I can match on company name, but there are times when the company
name is not unique and I have to use first/last name. The following is an
example of data on the worksheet I am trying to retreive from:


Acutech 12/01/05 N Ms. Linda Dendy
Adams Simpson LLP 12/01/05 N Mr. Jesse Evans
Adams Simpson LLP 01/01/06 N Ms. Deborah Hembree

I am using the following: =INDEX(Misc!$A:$C,MATCH(C38,Misc!$A:$A,0),2).
This will work and find the match, pick the date (from the second column),
but in the case where the company is Adams Simpson LLP, it will always choose
the 12/01/05 date. I need to find both. So I would need to match on the
first and last name if there is more than one entry of the company.

Can this be done (simply)? Thank you.

--
hgopp99
--
hgopp99


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
hgopp99
 
Posts: n/a
Default Retreive data from another worksheet based on multiple columns

Can you explain, in more detail, what the $A, $B, and $C represent? Also
what did (one cell) mean? I did not understand your reply.

I am trying to get the date, which is in the second column of one sheet to
the first column of another. The company, which is one field they have in
common is in the third column of the first sheet and the first column of the
sheet that I am trying to retreive my data. That is why I was originally
using:
=INDEX(Misc!$A:$C,MATCH(C38,Misc!$A:$A,0),2).

--
hgopp99


"Dave Peterson" wrote:

You can use this kind of syntax:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)*(b2=othersheet !$b$1:$b$100),0))
(one cell)

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can't use the whole column.

hgopp99 wrote:

I am trying to retreive a date from one worksheet and place it on another.
Most often, I can match on company name, but there are times when the company
name is not unique and I have to use first/last name. The following is an
example of data on the worksheet I am trying to retreive from:


Acutech 12/01/05 N Ms. Linda Dendy
Adams Simpson LLP 12/01/05 N Mr. Jesse Evans
Adams Simpson LLP 01/01/06 N Ms. Deborah Hembree

I am using the following: =INDEX(Misc!$A:$C,MATCH(C38,Misc!$A:$A,0),2).
This will work and find the match, pick the date (from the second column),
but in the case where the company is Adams Simpson LLP, it will always choose
the 12/01/05 date. I need to find both. So I would need to match on the
first and last name if there is more than one entry of the company.

Can this be done (simply)? Thank you.

--
hgopp99
--
hgopp99


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Retreive data from another worksheet based on multiple columns

This formula would wrap in the newsgroup post. So I split it into two lines:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)*(b2=othersheet !$b$1:$b$100),0))

But when you use it, it would go into one cell--not two separate cells. (That
was the easy part <bg.)

Say I want to do essentially a =vlookup() based on two different cells. My
table has the key values in column A and column B (and it's on a worksheet named
OtherSheet.

And I want to bring back the value from column C of othersheet.

So I put the value to match othersheet column A in A2 of my current worksheet.

I put the value to match column B in B2 of my current worksheet.

Then that formula will look through all of othersheet and find the first row
where both column A and column B match my input. Then it'll bring back the
stuff in column C.

I used $a$1:$a$100, $b1:$b$100, and $c$1:$c$100 to hold that table (on
OtherSheet).

I'm gonna stick with a 100 rows, but you can make it as large as you want--but
not the whole column:

In the table:
Company name is in column A.
First name is in column E.
Last name is in column F.
And the data you want to bring back is in column B(??)
(difficult for me to see, but you can change it to what you need)

On your input sheet:
company name is in column C.
first name is in column X (you didn't say, or I missed it)
lastname is in column Y (You didn't say, or did I miss it again)

So that formula (all one cell again becomes something like:

=index(othersheet!$b$1:$b$100,
match(1,(c2=othersheet!$a$1:$a$100)
*(x2=othersheet!$e$1:$e$100)
*(y2=othersheet!$F$1:$f$100),0))


Remember...

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can't use the whole column.



hgopp99 wrote:

Can you explain, in more detail, what the $A, $B, and $C represent? Also
what did (one cell) mean? I did not understand your reply.

I am trying to get the date, which is in the second column of one sheet to
the first column of another. The company, which is one field they have in
common is in the third column of the first sheet and the first column of the
sheet that I am trying to retreive my data. That is why I was originally
using:
=INDEX(Misc!$A:$C,MATCH(C38,Misc!$A:$A,0),2).

--
hgopp99

"Dave Peterson" wrote:

You can use this kind of syntax:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)*(b2=othersheet !$b$1:$b$100),0))
(one cell)

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can't use the whole column.

hgopp99 wrote:

I am trying to retreive a date from one worksheet and place it on another.
Most often, I can match on company name, but there are times when the company
name is not unique and I have to use first/last name. The following is an
example of data on the worksheet I am trying to retreive from:


Acutech 12/01/05 N Ms. Linda Dendy
Adams Simpson LLP 12/01/05 N Mr. Jesse Evans
Adams Simpson LLP 01/01/06 N Ms. Deborah Hembree

I am using the following: =INDEX(Misc!$A:$C,MATCH(C38,Misc!$A:$A,0),2).
This will work and find the match, pick the date (from the second column),
but in the case where the company is Adams Simpson LLP, it will always choose
the 12/01/05 date. I need to find both. So I would need to match on the
first and last name if there is more than one entry of the company.

Can this be done (simply)? Thank you.

--
hgopp99
--
hgopp99


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
hgopp99
 
Posts: n/a
Default Retreive data from another worksheet based on multiple columns

Thank you for the breakdown. I haven't tried it yet, but will before the
evening is over.
--
hgopp99


"Dave Peterson" wrote:

This formula would wrap in the newsgroup post. So I split it into two lines:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)*(b2=othersheet !$b$1:$b$100),0))

But when you use it, it would go into one cell--not two separate cells. (That
was the easy part <bg.)

Say I want to do essentially a =vlookup() based on two different cells. My
table has the key values in column A and column B (and it's on a worksheet named
OtherSheet.

And I want to bring back the value from column C of othersheet.

So I put the value to match othersheet column A in A2 of my current worksheet.

I put the value to match column B in B2 of my current worksheet.

Then that formula will look through all of othersheet and find the first row
where both column A and column B match my input. Then it'll bring back the
stuff in column C.

I used $a$1:$a$100, $b1:$b$100, and $c$1:$c$100 to hold that table (on
OtherSheet).

I'm gonna stick with a 100 rows, but you can make it as large as you want--but
not the whole column:

In the table:
Company name is in column A.
First name is in column E.
Last name is in column F.
And the data you want to bring back is in column B(??)
(difficult for me to see, but you can change it to what you need)

On your input sheet:
company name is in column C.
first name is in column X (you didn't say, or I missed it)
lastname is in column Y (You didn't say, or did I miss it again)

So that formula (all one cell again becomes something like:

=index(othersheet!$b$1:$b$100,
match(1,(c2=othersheet!$a$1:$a$100)
*(x2=othersheet!$e$1:$e$100)
*(y2=othersheet!$F$1:$f$100),0))


Remember...

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can't use the whole column.



hgopp99 wrote:

Can you explain, in more detail, what the $A, $B, and $C represent? Also
what did (one cell) mean? I did not understand your reply.

I am trying to get the date, which is in the second column of one sheet to
the first column of another. The company, which is one field they have in
common is in the third column of the first sheet and the first column of the
sheet that I am trying to retreive my data. That is why I was originally
using:
=INDEX(Misc!$A:$C,MATCH(C38,Misc!$A:$A,0),2).

--
hgopp99

"Dave Peterson" wrote:

You can use this kind of syntax:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)*(b2=othersheet !$b$1:$b$100),0))
(one cell)

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can't use the whole column.

hgopp99 wrote:

I am trying to retreive a date from one worksheet and place it on another.
Most often, I can match on company name, but there are times when the company
name is not unique and I have to use first/last name. The following is an
example of data on the worksheet I am trying to retreive from:


Acutech 12/01/05 N Ms. Linda Dendy
Adams Simpson LLP 12/01/05 N Mr. Jesse Evans
Adams Simpson LLP 01/01/06 N Ms. Deborah Hembree

I am using the following: =INDEX(Misc!$A:$C,MATCH(C38,Misc!$A:$A,0),2).
This will work and find the match, pick the date (from the second column),
but in the case where the company is Adams Simpson LLP, it will always choose
the 12/01/05 date. I need to find both. So I would need to match on the
first and last name if there is more than one entry of the company.

Can this be done (simply)? Thank you.

--
hgopp99
--
hgopp99

--

Dave Peterson


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.misc
hgopp99
 
Posts: n/a
Default Retreive data from another worksheet based on multiple columns

Thank you for your patience. I now better understand the INDEX/MATCH array.
--
hgopp99


"hgopp99" wrote:

Thank you for the breakdown. I haven't tried it yet, but will before the
evening is over.
--
hgopp99


"Dave Peterson" wrote:

This formula would wrap in the newsgroup post. So I split it into two lines:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)*(b2=othersheet !$b$1:$b$100),0))

But when you use it, it would go into one cell--not two separate cells. (That
was the easy part <bg.)

Say I want to do essentially a =vlookup() based on two different cells. My
table has the key values in column A and column B (and it's on a worksheet named
OtherSheet.

And I want to bring back the value from column C of othersheet.

So I put the value to match othersheet column A in A2 of my current worksheet.

I put the value to match column B in B2 of my current worksheet.

Then that formula will look through all of othersheet and find the first row
where both column A and column B match my input. Then it'll bring back the
stuff in column C.

I used $a$1:$a$100, $b1:$b$100, and $c$1:$c$100 to hold that table (on
OtherSheet).

I'm gonna stick with a 100 rows, but you can make it as large as you want--but
not the whole column:

In the table:
Company name is in column A.
First name is in column E.
Last name is in column F.
And the data you want to bring back is in column B(??)
(difficult for me to see, but you can change it to what you need)

On your input sheet:
company name is in column C.
first name is in column X (you didn't say, or I missed it)
lastname is in column Y (You didn't say, or did I miss it again)

So that formula (all one cell again becomes something like:

=index(othersheet!$b$1:$b$100,
match(1,(c2=othersheet!$a$1:$a$100)
*(x2=othersheet!$e$1:$e$100)
*(y2=othersheet!$F$1:$f$100),0))


Remember...

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can't use the whole column.



hgopp99 wrote:

Can you explain, in more detail, what the $A, $B, and $C represent? Also
what did (one cell) mean? I did not understand your reply.

I am trying to get the date, which is in the second column of one sheet to
the first column of another. The company, which is one field they have in
common is in the third column of the first sheet and the first column of the
sheet that I am trying to retreive my data. That is why I was originally
using:
=INDEX(Misc!$A:$C,MATCH(C38,Misc!$A:$A,0),2).

--
hgopp99

"Dave Peterson" wrote:

You can use this kind of syntax:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)*(b2=othersheet !$b$1:$b$100),0))
(one cell)

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can't use the whole column.

hgopp99 wrote:

I am trying to retreive a date from one worksheet and place it on another.
Most often, I can match on company name, but there are times when the company
name is not unique and I have to use first/last name. The following is an
example of data on the worksheet I am trying to retreive from:


Acutech 12/01/05 N Ms. Linda Dendy
Adams Simpson LLP 12/01/05 N Mr. Jesse Evans
Adams Simpson LLP 01/01/06 N Ms. Deborah Hembree

I am using the following: =INDEX(Misc!$A:$C,MATCH(C38,Misc!$A:$A,0),2).
This will work and find the match, pick the date (from the second column),
but in the case where the company is Adams Simpson LLP, it will always choose
the 12/01/05 date. I need to find both. So I would need to match on the
first and last name if there is more than one entry of the company.

Can this be done (simply)? Thank you.

--
hgopp99
--
hgopp99

--

Dave Peterson


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Retreive data from another worksheet based on multiple columns

Glad you got it working.

hgopp99 wrote:

Thank you for your patience. I now better understand the INDEX/MATCH array.
--
hgopp99

"hgopp99" wrote:

Thank you for the breakdown. I haven't tried it yet, but will before the
evening is over.
--
hgopp99


"Dave Peterson" wrote:

This formula would wrap in the newsgroup post. So I split it into two lines:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)*(b2=othersheet !$b$1:$b$100),0))

But when you use it, it would go into one cell--not two separate cells. (That
was the easy part <bg.)

Say I want to do essentially a =vlookup() based on two different cells. My
table has the key values in column A and column B (and it's on a worksheet named
OtherSheet.

And I want to bring back the value from column C of othersheet.

So I put the value to match othersheet column A in A2 of my current worksheet.

I put the value to match column B in B2 of my current worksheet.

Then that formula will look through all of othersheet and find the first row
where both column A and column B match my input. Then it'll bring back the
stuff in column C.

I used $a$1:$a$100, $b1:$b$100, and $c$1:$c$100 to hold that table (on
OtherSheet).

I'm gonna stick with a 100 rows, but you can make it as large as you want--but
not the whole column:

In the table:
Company name is in column A.
First name is in column E.
Last name is in column F.
And the data you want to bring back is in column B(??)
(difficult for me to see, but you can change it to what you need)

On your input sheet:
company name is in column C.
first name is in column X (you didn't say, or I missed it)
lastname is in column Y (You didn't say, or did I miss it again)

So that formula (all one cell again becomes something like:

=index(othersheet!$b$1:$b$100,
match(1,(c2=othersheet!$a$1:$a$100)
*(x2=othersheet!$e$1:$e$100)
*(y2=othersheet!$F$1:$f$100),0))


Remember...

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can't use the whole column.



hgopp99 wrote:

Can you explain, in more detail, what the $A, $B, and $C represent? Also
what did (one cell) mean? I did not understand your reply.

I am trying to get the date, which is in the second column of one sheet to
the first column of another. The company, which is one field they have in
common is in the third column of the first sheet and the first column of the
sheet that I am trying to retreive my data. That is why I was originally
using:
=INDEX(Misc!$A:$C,MATCH(C38,Misc!$A:$A,0),2).

--
hgopp99

"Dave Peterson" wrote:

You can use this kind of syntax:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)*(b2=othersheet !$b$1:$b$100),0))
(one cell)

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can't use the whole column.

hgopp99 wrote:

I am trying to retreive a date from one worksheet and place it on another.
Most often, I can match on company name, but there are times when the company
name is not unique and I have to use first/last name. The following is an
example of data on the worksheet I am trying to retreive from:


Acutech 12/01/05 N Ms. Linda Dendy
Adams Simpson LLP 12/01/05 N Mr. Jesse Evans
Adams Simpson LLP 01/01/06 N Ms. Deborah Hembree

I am using the following: =INDEX(Misc!$A:$C,MATCH(C38,Misc!$A:$A,0),2).
This will work and find the match, pick the date (from the second column),
but in the case where the company is Adams Simpson LLP, it will always choose
the 12/01/05 date. I need to find both. So I would need to match on the
first and last name if there is more than one entry of the company.

Can this be done (simply)? Thank you.

--
hgopp99
--
hgopp99

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
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
Combining Data from Multiple Columns JT Excel Worksheet Functions 2 January 8th 06 07:39 PM
Excel Macro to Copy & Paste [email protected] Excel Worksheet Functions 0 December 1st 05 01:56 PM
sorting data across multiple columns Spiderman Excel Discussion (Misc queries) 2 October 6th 05 11:55 PM
splitting 1 column of data into multiple columns CiceroCF Setting up and Configuration of Excel 1 March 25th 05 01:50 AM
spliting a column of data into multiple columns CiceroCF Excel Discussion (Misc queries) 7 March 25th 05 12:40 AM


All times are GMT +1. The time now is 11:18 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"