Hi,
I have a 3-sheet workbook where I need a cell in sheet 3 to look at the data in Sheet 1 or Sheet 2, and return all instances of the lookup into 1 cell separated by a comma in Sheet 3.
Hi,
I have a 3-sheet workbook where I need a cell in sheet 3 to look at the data in Sheet 1 or Sheet 2, and return all instances of the lookup into 1 cell separated by a comma in Sheet 3.
Last edited by ConanPBG; 11-06-2018 at 01:07 PM.
Please upload a workbook or a representative cut down copy, anonymised if necessary. It is always easier to advise if we can see your request in its context.
Show a before and after situation with manually calculated results, explaining which information is data and which is results, and if it's not blindingly obvious how you have arrived at your results some explanatory notes as well.
Would you also explain the overall process. By that I dpn;t mean tell us wat you're exsiting formulae mean, but tell us what you start with and how you process it to arrive at the results you show.
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star icon below the post.
I did upload the workbook in the original post.
I haven't the faintest idea what you want. Please add some manually calculated answers.
Glenn
None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.
Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh
in sheet 3, I put the request in cell J3. So, I am looking for J4 to show 01-113-A, 16-031-A when looking up A3 in either Sheet 1 or Sheet 2
OK. Clear!! One more Q. Can there be MORE THAN 1 match per sheet (thus more than two in total)? If more than1 per sheet, have you any idea how many (roughly)?
yes, there can be more than 1. basically, it needs to look at the data from an inventory scan, and pull every sticker where the product was scanned. Ont he example, there is 1 article that is in 34 different stickers (locations).
This will need VBA. Is that OK?
Sure, if there are no other options
With 34.... there are NO other options.
You didn't say which columns I should be looking at in in sheet 2... so I guessed.
How to install your new codePlease Login or Register to view this content.
Copy the Excel VBA code
Select the workbook in which you want to store the Excel VBA code
Press Alt+F11 to open the Visual Basic Editor
Choose Insert > Module
Edit > Paste the macro into the module that appeared
Close the VBEditor
Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)
Then use this array formula in A3:
=ConcatAll(IF('Sheet 1'!$A$2:$A$79=A3,'Sheet 1'!$B$2:$B$79,""),", ")&", "&ConcatAll(IF('Sheet 2'!$E$2:$E$79=A3,'Sheet 2'!$H$2:$H$79,""),", ")
Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.
You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.
Don't type the curly brackets yourself - it won't work...
Any reason why column I is highlighted in yellow?
I highlighted cells in yellow that were formulas for my own sense check. Thank you for this!
OK!! I just thought I might have missed something.... again.
You're welcome.
If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.
It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.
The only issue I see is that it is pulling an extra item... for example, HVKG-APR16930A is only in 2 bins (01-113-A, 16-031-A,), but it is bulling an additional bin: 01-022-A
Gimme 5...
Sheet 1 Rows 4 and 62 and Sheet 2 row 9.... 3 in total.
It only needed to return either that data from Sheet 1 columns A - B OR the data from sheet 2 columns A - B. Sheet 2 is just three separate pivot tables, and it looks like you have it looking at both the 2nd and 3rd pivots.
I misread your request. I thought you wanted me to look at BOTH sheets. So, amend the array formula to:
=ConcatAll(IF('Sheet 1'!$A$2:$A$79=A3,'Sheet 1'!$B$2:$B$79,""),", ")
and it looks only at Sheet 1.
If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.
It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks