Wednesday, September 08, 2010   
  Search   
 

Office 2010 - Launch Event

Register  Login  
Forums  
     Minimize  

MeraWindows Forums - Get your Computer Problems Fixed

This is a site run by the community - for the community. At the site, we share and contribute our computer learnings with each other. We discuss about Windows, Office, Mobile, Gaming and other computer related topics. At our forums you can post your queries and our very helpful community members will respond quickly to your queries. We organize lots of competitions from time to time and award prizes to the winners.
You will need to register at the site before posting in forums. It's absolutely free. After registering, you can get all the benefits available to our registered members, you can access our Downloads section, you can participate in contests, etc. You can post in forums in English as well as in Hindi, in fact we encourage you to use Hindi in your posts. If you have any problem with registration or login, please contact us.

     
  
 
Computer Forums for Windows UsersComputer Forums for Windows UsersMicrosoft Offic...Microsoft Offic...Microsoft ExcelMicrosoft ExcelXP / Excel 2007 - Lookup with single value and return multiple resultsXP / Excel 2007 - Lookup with single value and return multiple results
Previous Previous
 
Next Next
New Post
 7/23/2010 11:37 PM
 
To whom it may concern:

Looking for some help with a problem I've been fighting.  My PC runs XP with Excel 2007.  I'm trying to use a value from sheet 2 to find all the occurences of that value in column A on sheet 1 and then return multple information back to sheet 2.

My sheet 1 looks something like this:
OLD     NEW  DESC
 A1  AA1  ITEM1
 A1  AA2  ITEM2
 A2  AA3  ITEM3
 A3  AA4  ITEM4
 A4  AA5  ITEM5
 A4  AA6  ITEM6
 A5  AA7  ITEM7

My sheet 2 looks something like this:
 DELETE KEY  REF# DELETE DATE  NEW ITEM CODE1  NEW ITEM DESC1  NEW ITEM CODE2      NEW ITEM DESC2
 A1  1/1/2010        
 A3  2/1/2010        

I need to use the "DELETE KEY" column in sheet 2 to find the value in the "OLD" column in sheet 1 and then return the value in the "NEW" & "DESC" columns in sheet 1 to the "NEW ITEM CODE" & "NEW ITEM DESC" columns in sheet 2.  The problem I have is when there is more than 1 "OLD" value in sheet 1 that matches my "DELETE KEY" in sheet 2.  If there is only 1 occurrence, I need to return the values to "NEW ITEM CODE1" & "NEW ITEM DESC1" respectively, but when there are 2 occurrences the 2nd occurrence needs to end up in "NEW ITEM CODE2" & "NEW ITEM DESC2".

So my results should look like this: 
 DELETE KEY  REF# DELETE DATE  NEW ITEM CODE1  NEW ITEM DESC1  NEW ITEM CODE2      NEW ITEM DESC2
 A1  1/1/2010  AA1  ITEM1  AA2   ITEM2 
 A3  2/1/2010  AA4  ITEM4     

If anyone has done this in the past I'd appreciate some assistance with it! 

laynegray

PS-The simplier the better I'd refer to myself as a casual Excel user.  I can get around OK, but I'm not building a rocket ship any time soon:)  Thanks again!!

New Post
 7/24/2010 4:48 AM
 
 Modified By Ashish Mathur  on 7/24/2010 4:50:08 AM
Hi,

Suppose original data is in range A3:C10 (row 3 is the header row).  Suppose A1 is typed in cell A16 and A3 is typed in A17.  Try the following:

1. To get New item code 1, use the following formula =VLOOKUP($A16,$A$4:$C$10,2,0) and copy down
2. To get New item desc 1, use the following formula =VLOOKUP($A16,$A$4:$C$10,3,0) and copy down
3. To get New item code 2, use the following array formula (confirmed by Ctrl+Shift+enter) and copy down

=IF(ISERROR(INDEX($A$4:$C$10,SMALL(IF($A$4:$A$10=$A16,ROW($A$4:$A$10)-ROW($A$3)),2),2)),"",INDEX($A$4:$C$10,SMALL(IF($A$4:$A$10=$A16,ROW($A$4:$A$10)-ROW($A$3)),2),2))

4. To get New item description 2, use the following array formula (confirmed by Ctrl+Shift+enter) and copy down

=IF(ISERROR(INDEX($A$4:$C$10,SMALL(IF($A$4:$A$10=$A16,ROW($A$4:$A$10)-ROW($A$3)),2),3)),"",INDEX($A$4:$C$10,SMALL(IF($A$4:$A$10=$A16,ROW($A$4:$A$10)-ROW($A$3)),2),3))

Hope this helps.  Please let me know how this works.

For Microsoft Excel trainings in India, please visit http://ashishmathur.com/training.aspx

Regards,

Ashish Mathur - View Ashish Mathur's profile on LinkedIn
Microsoft Excel MVP
www.ashishmathur.com

New Post
 7/27/2010 5:59 PM
 
Thanks for the reply Ashish!

I was able to get part of your solution to work for my problem. 

The VLOOKUP to get New item code 1 and New item desc 1 worked.  I could not get the formula to quite work for retrieving New item code 2. 
New Post
 7/27/2010 9:13 PM
 
Hi,

Please upload the file on some free file hosting server such as www.mediafire.com and post a link to the uploaded file as a response to this thread

For Microsoft Excel trainings in India, please visit http://ashishmathur.com/training.aspx

Regards,

Ashish Mathur - View Ashish Mathur's profile on LinkedIn
Microsoft Excel MVP
www.ashishmathur.com

Previous Previous
 
Next Next
Computer Forums for Windows UsersComputer Forums for Windows UsersMicrosoft Offic...Microsoft Offic...Microsoft ExcelMicrosoft ExcelXP / Excel 2007 - Lookup with single value and return multiple resultsXP / Excel 2007 - Lookup with single value and return multiple results



 

   User Log In Minimize  


Register
Forgot Password ?

     
  
   Top Contributors Minimize  
Most Active Users for 1 Week
UserTotalPosts
samagg 76
vasu.jain 26
ankur mittal 23
rockstarvipul 23
UmangGupta 18
     
  
   Follow Us Minimize  

MeraWindows

Follow abhishekkant on Twitter

Windows Live Alerts

     
  
     Minimize