Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default How do I extract a second data in a Lookup

I have a data that contains employee numbers and amount earned as bonus. Some
of the employees earn bonuses from one or two schemes. When I use VLOOKUP to
extract data, the expression only picks the first amount that is found in the
database. How can I go about it so that the second number of the same
employee will pick the second amount?

Extract from database
Emp# Amt
MC5604 $20
MC5604 $50

Current result
Emp# Amt
MC5604 $20
MC5604 $20

Expected result
Emp# Amt
MC5604 $20
MC5604 $50

Thank you

Darkwah

  #2   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default How do I extract a second data in a Lookup

Assume database in Sheet1, cols A and B, data from row2 down
Put in C2: =COUNTIF(A$2:A2,A2)
Copy down

Then in Sheet2,
With the Emp#s running in row2 down

place in B2, then array-enter the formula, ie press CTRL+SHIFT+ENTER
instead of just pressing ENTER:
=INDEX(Sheet1!$B$2:$B$100,MATCH(A2&COUNTIF(A$2:A2, A2),Sheet1!$A$2:$A$100&Sheet1!$C$2:$C$100,0))
Copy B2 down to return required results. Adapt the ranges to suit.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Darkwah" wrote:
I have a data that contains employee numbers and amount earned as bonus. Some
of the employees earn bonuses from one or two schemes. When I use VLOOKUP to
extract data, the expression only picks the first amount that is found in the
database. How can I go about it so that the second number of the same
employee will pick the second amount?

Extract from database
Emp# Amt
MC5604 $20
MC5604 $50

Current result
Emp# Amt
MC5604 $20
MC5604 $20

Expected result
Emp# Amt
MC5604 $20
MC5604 $50

Thank you

Darkwah

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default How do I extract a second data in a Lookup

Max,

Many thanks. It is working perfectly! I could not have done it without your
help.

Darkwah.
Ghana

"Max" wrote:

Assume database in Sheet1, cols A and B, data from row2 down
Put in C2: =COUNTIF(A$2:A2,A2)
Copy down

Then in Sheet2,
With the Emp#s running in row2 down

place in B2, then array-enter the formula, ie press CTRL+SHIFT+ENTER
instead of just pressing ENTER:
=INDEX(Sheet1!$B$2:$B$100,MATCH(A2&COUNTIF(A$2:A2, A2),Sheet1!$A$2:$A$100&Sheet1!$C$2:$C$100,0))
Copy B2 down to return required results. Adapt the ranges to suit.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Darkwah" wrote:
I have a data that contains employee numbers and amount earned as bonus. Some
of the employees earn bonuses from one or two schemes. When I use VLOOKUP to
extract data, the expression only picks the first amount that is found in the
database. How can I go about it so that the second number of the same
employee will pick the second amount?

Extract from database
Emp# Amt
MC5604 $20
MC5604 $50

Current result
Emp# Amt
MC5604 $20
MC5604 $20

Expected result
Emp# Amt
MC5604 $20
MC5604 $50

Thank you

Darkwah

  #4   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default How do I extract a second data in a Lookup

Pleased to hear that !
You're welcome.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Darkwah" wrote in message
...
Max,

Many thanks. It is working perfectly! I could not have done it without
your
help.

Darkwah.
Ghana



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
HOW TO EXTRACT (or lookup) DATA FROM A PIVOT TABLE SSJ New Users to Excel 3 November 9th 06 09:46 PM
data extract Mona Excel Worksheet Functions 7 May 10th 06 05:17 PM
AGAIN... I need another Lookup Function to extract some data BillReese Excel Worksheet Functions 2 May 9th 06 12:26 AM
How to extract the data Shiva Excel Worksheet Functions 2 November 1st 05 04:41 AM
Extract Data Tucson Guy Excel Discussion (Misc queries) 5 December 15th 04 09:41 PM


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

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"