Multiple values with same critiria

xsmurf

Board Regular
Joined
Feb 24, 2007
Messages
55
Office Version
  1. 365
Platform
  1. Windows
Hi,

I hope you guys can help me with a problem if have.

I have a code that looks up values in a separate excel file, this code works well (modified the location to the location
VBA Code:
=IFERROR(INDEX('C:\Users\123\Desktop\Excel WIP\[Production Report.xlsm]Production Reports'!$D$2:$D$2002,MATCH(B16&C16,'C:\Users\123\Desktop\Excel WIP\[Production Report.xlsm]Production Reports'!$C$2:$C$2002&'C:\Users\123\Desktop\Excel WIP\[Production Report.xlsm]Production Reports'!$F$2:$F$2002,0)),"")

My problem is that sometimes there will be an extra row with the same lookup values, however my lookup code only shows one value and not the next one.
I would like to show both values with the same lookup values.
So if row 9 & row 10 have different values but the lookup values are the same I would like to see both values. ( in cells underneath each other)

Can somebody help me to adjust my code so it shows all the values.

Thank you so much for the help.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi XSmurf

Here's the Production Reports
XSmurf.xlsx
CDEF
1CDF
2WMoleT
3ZCatX
4ADogB
5ZGoatX
6ASheepB
7
8ABadgerB
9ZVoleX
10AFoxB
11ZHorseX
12
Production Reports


Here's the retrieval into cells underneath:

XSmurf.xlsx
ABC
15Results
16CatZX
17Goat
18Vole
19Horse
20 
1st
Cell Formulas
RangeFormula
A16:A20A16=IFERROR(INDEX('Production Reports'!$D$2:$D$2000,AGGREGATE(15,6,ROW('Production Reports'!$C$2:$C$2000)-ROW('Production Reports'!$C$1)/(('Production Reports'!$C$2:$C$2000=$B$16)*('Production Reports'!$F$2:$F$2000=$C$16)),ROW()-ROW($A$15))),"")
 
Upvote 0
Hi ToadStool,

Thank you for replying. I need to say sorry because I read my post back and I did not provide the proper info,

The tab Production Reports is the tab where my info is in.
This tab has 40 columns, and rows are added 3 times a day and sometimes 4 or 5 times a day.

In my search sheet I retrieve info from the 40 columns in the production tab.
The 2 values I look up are in column B & C on the search sheet.
Column B has a date in it and column C has a reference number, these values can change per row.

The other columns in the search tab will show the date that belongs to the search values on that row.
Sometimes the search values are the same for 2 rows but the values in the rest of the columns is different.

In my search tab I would like to see those 2 rows with the different data in it.
The search info will give me around 42 rows in total depending on the data during the week.

If needed I can try to make a mini sheet but I will have to remove some sensitive information first.

hope you can still help me.

Thank you in advance
 
Upvote 0
I'm not understanding so yes, mini-sheets would be useful with your Production Reports sheet, but more importantly your search sheet with a worked example of output.

You should also update your profile with your Excel version as I use Excel 2016 but others may be able to provide a better solution if you have Excel 2019, 2021 or 365.
 
Upvote 0
Your first post said "I would like to see both values. ( in cells underneath each other)" but that would involve inserting rows as B & C already contain data so for that you'd need VBA.

I can rebuild columns B & C into new columns with the new rows included but for my Excel 2016 that would need me to add helper columns. Another 365 forum member may be able to provide a better solution.

The row 28 you highlight in yellow doesn't have a duplicate Jan 16, 2022 and C7 in the Production Reports, only row 20 for Jan 13, 2022 and B4 has a duplicate.

Another approach would be to build columns B and C from scratch. It appears that your first B date is that specified in A4 and then you have three entries for each day (an A, a B and a C" suffixed by the day of the week. There would be additional entries for each day where multiple entries for a Date, column C are found in the Production Reports. Let me know if you want me to try that.
 
Upvote 0
Your first post said "I would like to see both values. ( in cells underneath each other)" but that would involve inserting rows as B & C already contain data so for that you'd need VBA.

I can rebuild columns B & C into new columns with the new rows included but for my Excel 2016 that would need me to add helper columns. Another 365 forum member may be able to provide a better solution.

The row 28 you highlight in yellow doesn't have a duplicate Jan 16, 2022 and C7 in the Production Reports, only row 20 for Jan 13, 2022 and B4 has a duplicate.

Another approach would be to build columns B and C from scratch. It appears that your first B date is that specified in A4 and then you have three entries for each day (an A, a B and a C" suffixed by the day of the week. There would be additional entries for each day where multiple entries for a Date, column C are found in the Production Reports. Let me know if you want me to try that.
Sorry the late reply, had some personal issues.

I still haven't found a answer to my problem.
If you can and have time could you try your solution.

Unless somebody has a office 365 solution.

Anyway I would like to thank you (or who else will help out) for the assistance, I really appreciate it.
 
Upvote 0
Sorry the late reply, had some personal issues.

I still haven't found a answer to my problem.
If you can and have time could you try your solution.

Unless somebody has a office 365 solution.

Anyway I would like to thank you (or who else will help out) for the assistance, I really appreciate it.
I am using this code now

VBA Code:
=IFERROR(INDEX('\\drive01\Shared_Folders\Production Reports\[Production Report.xlsm]Production Reports'!$D$2:$D$2000,MATCH(B19&C19,'\\drive01\Shared_Folders\Production Reports\[Production Report.xlsm]Production Reports'!$C$2:$C$2000&'\\drive01\Shared_Folders\Production Reports\[Production Report.xlsm]Production Reports'!$F$2:$F$2000,0)),"")

I need to retrieve the values from a different workbook, that match the criteria based in my other workbook in cell B19&C19
 
Upvote 0
I need to retrieve the values from a different workbook, that match the criteria based in my other workbook in cell B19&C19
I mean multiple values of 2 criteria in a different workbook
 
Upvote 0
Hi,

I am still struggling to find a proper code to find multiple results, and I really hope someone can help me.
The code I am using now:
VBA Code:
=IFERROR(INDEX('Production Reports'!$D$2:$D$2002,MATCH(B27&C27,'Production Reports'!$C$2:$C$2002&'Production Reports'!$F$2:$F$2002,0)),"")

This will only show me 1 result, but if I have 2 results below each other I would like to see that result too.
The results will be shown beneath each other.
I am using this code in 1 workbook to look in a different sheet, but this code will also be used in a different workbook that retrieves values from different workbooks.

Thank for the help in advance.
 
Upvote 0

Forum statistics

Threads
1,215,506
Messages
6,125,194
Members
449,214
Latest member
mr_ordinaryboy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top