Function, Formula or VBA please help

LadyHarper

New Member
Joined
Jun 28, 2017
Messages
48
Office Version
  1. 365
Platform
  1. Windows
I have a Spread Sheet Columns A through F

In another work book, I need to pull over information.
I need it to look at Cells A1 and compare this to column B in other book, and look at B1 and compare to column E in other book and give me a list of each line from F that meets those criteria's from the other book.

Please help.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
If I follow your description, this is one approach using formulas. Here I have a source data workbook named AnotherWorkbook containing a sheet named sourcedata that holds information in columns A:F. Another workbook named LadyHarper contains a worksheet named Sheet1, and on Sheet1 the user enters lookup query inputs in cells A1 and B1. For illustration purposes, I considered cell A1 to hold a name and B1 to hold a month. Then using a formula, cell A1 on Sheet1 is matched to all entries in column B of worksheet sourcedata (in AnotherWorkbook), and cell B1 on Sheet 1 is matched to all entries in column E of worksheet sourcedata (in AnotherWorkbook). Only when both of those conditions match is the line entry in sourcedata considered a "match", and the corresponding value in column F of worksheet sourcedata is returned. Since there may be multiple matches, the formula is dragged down to make room for listing each of the matches.

AnotherWorkbook.xlsx
ABCDEF
1Data1NameData3Data4MonthDataColF
2AAl1021xyzJunetop
3BBeth1022abcAugustbottom
4CCharles1023defSeptemberleft
5DDelilah1024ghiMarchright
6EEd1025jklAprilnorth
7FTom1026mnoJanuarysouth
8GBeth1027pqrMayeast
9HCharles1028stuOctoberwest
10IDelilah1029vwzMarchover
11JTom1030bcdFebruaryunder
12KEd1031efgJulyport
13LTom1032hijJanuarystarboard
14MTom1033klmJanuarytop
sourcedata


LadyHarper.xlsx
ABC
1TomJanuarymatching column f
2south
3starboard
4top
5 
6 
7 
8 
9
Sheet1
Cell Formulas
RangeFormula
C2:C8C2=IFERROR(INDEX([AnotherWorkbook.xlsx]sourcedata!$F:$F,AGGREGATE(15,6,(ROW([AnotherWorkbook.xlsx]sourcedata!$B:$B))/(([AnotherWorkbook.xlsx]sourcedata!$B:$B=$A$1)*([AnotherWorkbook.xlsx]sourcedata!$E:$E=$B$1)),IF(ROWS(C$2:C2)<=COUNTIFS([AnotherWorkbook.xlsx]sourcedata!$B:$B,$A$1,[AnotherWorkbook.xlsx]sourcedata!$E:$E,$B$1),ROWS(C$2:C2)))),"")
 
Upvote 0
@LadyHarper
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
If I follow your description, this is one approach using formulas. Here I have a source data workbook named AnotherWorkbook containing a sheet named sourcedata that holds information in columns A:F. Another workbook named LadyHarper contains a worksheet named Sheet1, and on Sheet1 the user enters lookup query inputs in cells A1 and B1. For illustration purposes, I considered cell A1 to hold a name and B1 to hold a month. Then using a formula, cell A1 on Sheet1 is matched to all entries in column B of worksheet sourcedata (in AnotherWorkbook), and cell B1 on Sheet 1 is matched to all entries in column E of worksheet sourcedata (in AnotherWorkbook). Only when both of those conditions match is the line entry in sourcedata considered a "match", and the corresponding value in column F of worksheet sourcedata is returned. Since there may be multiple matches, the formula is dragged down to make room for listing each of the matches.

AnotherWorkbook.xlsx
ABCDEF
1Data1NameData3Data4MonthDataColF
2AAl1021xyzJunetop
3BBeth1022abcAugustbottom
4CCharles1023defSeptemberleft
5DDelilah1024ghiMarchright
6EEd1025jklAprilnorth
7FTom1026mnoJanuarysouth
8GBeth1027pqrMayeast
9HCharles1028stuOctoberwest
10IDelilah1029vwzMarchover
11JTom1030bcdFebruaryunder
12KEd1031efgJulyport
13LTom1032hijJanuarystarboard
14MTom1033klmJanuarytop
sourcedata


LadyHarper.xlsx
ABC
1TomJanuarymatching column f
2south
3starboard
4top
5 
6 
7 
8 
9
Sheet1
Cell Formulas
RangeFormula
C2:C8C2=IFERROR(INDEX([AnotherWorkbook.xlsx]sourcedata!$F:$F,AGGREGATE(15,6,(ROW([AnotherWorkbook.xlsx]sourcedata!$B:$B))/(([AnotherWorkbook.xlsx]sourcedata!$B:$B=$A$1)*([AnotherWorkbook.xlsx]sourcedata!$E:$E=$B$1)),IF(ROWS(C$2:C2)<=COUNTIFS([AnotherWorkbook.xlsx]sourcedata!$B:$B,$A$1,[AnotherWorkbook.xlsx]sourcedata!$E:$E,$B$1),ROWS(C$2:C2)))),"")


So Column A on the other report has repetitive information and so does column E, so it is going to find these multiple times, and I need it to list everything it finds
 
Upvote 0
So Column A on the other report has repetitive information
Did you mean column B? No mention of column A in the other workbook in post #1.


so it is going to find these multiple times, and I need it to list everything it finds
Isn't that what KRice's results do?


Since you have updated your details (thanks for that) you could also use the FILTER function which only needs to be entered into a single cell (C2 in my case)

AnotherWorkbook.xlsx
ABCDEF
1Data1NameData3Data4MonthDataColF
2AAl1021xyzJunetop
3BBeth1022abcAugustbottom
4CCharles1023defSeptemberleft
5DDelilah1024ghiMarchright
6EEd1025jklAprilnorth
7FTom1026mnoJanuarysouth
8GBeth1027pqrMayeast
9HCharles1028stuOctoberwest
10IDelilah1029vwzMarchover
11JTom1030bcdFebruaryunder
12KEd1031efgJulyport
13LTom1032hijJanuarystarboard
14MTom1033klmJanuarytop
sourcedata



LadyHarper.xlsm
ABC
1TomJanuarymatching column f
2south
3starboard
4top
5
6
Sheet1
Cell Formulas
RangeFormula
C2:C4C2=FILTER([AnotherWorkbook.xlsx]sourcedata!$F$2:$F$100,(([AnotherWorkbook.xlsx]sourcedata!$B$2:$B$100=A1)*([AnotherWorkbook.xlsx]sourcedata!$E$2:$E$100=B1)),"")
Dynamic array formulas.
 
Upvote 0
Solution
So Column A on the other report has repetitive information and so does column E, so it is going to find these multiple times, and I need it to list everything it finds
I'm confused by your reply. Would you like to find all instances where cell A1 matches column B (stated in post #1) or where cell A1 matches column A (suggested in post #4)? The solutions proposed above find multiple matches where: 1) A1 matches column B, and 2) B1 matches column E. For each row where those conditions are both true, the corresponding information found in column F is returned. Since you have 365, Peter's implementation of the FILTER function would be the preferred approach.
 
Upvote 0
Did you mean column B? No mention of column A in the other workbook in post #1.



Isn't that what KRice's results do?


Since you have updated your details (thanks for that) you could also use the FILTER function which only needs to be entered into a single cell (C2 in my case)

AnotherWorkbook.xlsx
ABCDEF
1Data1NameData3Data4MonthDataColF
2AAl1021xyzJunetop
3BBeth1022abcAugustbottom
4CCharles1023defSeptemberleft
5DDelilah1024ghiMarchright
6EEd1025jklAprilnorth
7FTom1026mnoJanuarysouth
8GBeth1027pqrMayeast
9HCharles1028stuOctoberwest
10IDelilah1029vwzMarchover
11JTom1030bcdFebruaryunder
12KEd1031efgJulyport
13LTom1032hijJanuarystarboard
14MTom1033klmJanuarytop
sourcedata



LadyHarper.xlsm
ABC
1TomJanuarymatching column f
2south
3starboard
4top
5
6
Sheet1
Cell Formulas
RangeFormula
C2:C4C2=FILTER([AnotherWorkbook.xlsx]sourcedata!$F$2:$F$100,(([AnotherWorkbook.xlsx]sourcedata!$B$2:$B$100=A1)*([AnotherWorkbook.xlsx]sourcedata!$E$2:$E$100=B1)),"")
Dynamic array formulas.
Thank you both so very much. I was able to get the Filter one to work. and it is doing exactly what I need.
 
Upvote 0
Excellent...thanks for the update. We're happy to help.
 
Upvote 0
One more question. I am getting this error message... Links to "otherdocument" was not recalculated before it was saved.

First you should know I used the formula you wrote to do multiple B and E searches for different requirements. and it works beautifully. But is someone changes the column E Cell, I need my spreadsheet to do an automatic update.

Any suggestions? I use the main document (other document) in Sharepoint, and have to use my document in the APP as when opened in sharepoint it disables the links.
 
Upvote 0
The formulas used above assume that both workbooks are in the same folder. When you implemented the formula above, does the reference to the "otherdocument" change to reflect the path to that file's Sharepoint location, and then are you opening the file directly from its Sharepoint location?

Based on a request for help for the same issue that I found on another site (see below), resolving this error might be difficult.

As a work-around, although it adds a step, you might try copying that most recent version of otherdocument from Sharepoint into your local working folder where the "LadyHarper" workbook (i.e., what you referred to as "my document") is located.
 
Upvote 0

Forum statistics

Threads
1,215,480
Messages
6,125,049
Members
449,206
Latest member
Healthydogs

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