Solved

return multiple instance of a value in a rw

Posted on 2011-03-10
13
223 Views
Last Modified: 2012-05-11
Hi experts,

I have an excel pivot table with 400+ columns designating a "storage bin location"
There are 1200+ rows designating unique "Item #'s"
The pivot table values designate qty stored in each bin location
An item # may appear in multiple bin locations in the pivot table

I need a formula or method for returning the bin location for the 1st instance of a qty >0, then return the bin location of 2nd instance where qty>0, then 3rd...to n possible locations. Upper limit of n likely can be assumed less than 20 possible locations.

I was thinking adding 20 columns at the end of the pivot table and using a hlookup to find qty values >0 and return bin location on top row of pivot table. Problem is telling column 2 to return the bin location of the 2nd instance in the row, then column 3 to return 3rd instance, etc.

Any help greatly appreciated.

Kevin

0
Comment
Question by:KevinHatt
  • 6
  • 5
13 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 35095900
For example:
=INDEX(1:1,SMALL(IF(3:3>0,COLUMN(3:3)),2))
array-entered will return the value from row 1 for the second value greater than zero in row 3. Is that what you meant?
0
 

Author Comment

by:KevinHatt
ID: 35096002
Hi rorya,

I dont think so...

example:
                   [ Col1-Col2- Col3- Col4...Col400]    [Location1     Location2]...
item 123          4                5                                  Col1                Col3

does that make sense?

0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 35096023
Yes, that's basically what the formula I posted does. If you just want the column number (rather than the contents of row 1, then use:
=SMALL(IF(3:3>0,COLUMN(3:3)),1) for the first item
=SMALL(IF(3:3>0,COLUMN(3:3)),2) for the second item
etc.
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:KevinHatt
ID: 35097628
apologies for being obtuse Rorya...I think you are correct, I'm just fighting syntax here. Can I ask for some specific syntax for the given data range?

Row that contains Bin location is row 4
qty values are located in range b5 to pc5

Also...when entering the array range, is it necessary to ctrl+shift+enter?
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 35100352
Yes it must be ctrl+ shift+ enter
Basically use
=INDEX(4:4,SMALL(IF(b4:pc4>0,COLUMN(b4:pc4)),2))
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 35100365
Yes it must be ctrl+ shift+ enter
Basically use
=INDEX(4:4,SMALL(IF(b5:pc5>0,COLUMN(b5:pc5)),2)
0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 35107154
Correction:
=INDEX(B4:PC4,SMALL(IF(b4:pc4>0,COLUMN(b4:pc4)),2))
still array-entered.
0
 

Author Comment

by:KevinHatt
ID: 35114613
Hi rorya,

Your help was most gratefully received Master Savant. Formulas working as they should,aand client happy.

Full points to be awarded, and thanks again!

Kevin
0
 

Author Comment

by:KevinHatt
ID: 35114616
closed
0
 

Author Comment

by:KevinHatt
ID: 35114619
closed
0
 

Author Comment

by:KevinHatt
ID: 35114628
closed
0
 
LVL 24

Expert Comment

by:broomee9
ID: 35357007
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

775 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question