Index Match Formula returning more than just correct value

kmsprague

New Member
Joined
Nov 14, 2022
Messages
28
Office Version
  1. 365
Platform
  1. Windows
Hi there,
I'm using a formula with Index and Match (Excel 365) in an attempt to return all lines that contain certain the Company1 name. The formula works and it brings back the lines I need, but it also brings back other lines afterwards that don't match (see highlighted example below). Basically, I need it to stop populating information once the information from Company1 has all been brought into Sheet 2 so that I'm only capturing info from that company. Any help/ideas are greatly appreciated!! Thank you so much!

Here's my current formula: =INDEX('Sheet1'!$A2:$G$5,MATCH('Sheet2'!$B$2,'Sheet1'!$B2:$B5,0),0)

Sheet 1 with Info:
1668462667098.png


What's being returned in Sheet 2:
1668462702907.png
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Since you have Excel 365, try the FILTER function.

Sheet 1
Book2
ABCDEFG
1AccountCompanylDepartmentlLocationCompany2Department2Sum of Total
2123456ABCD001002EFGH1235
3123456ABCD001002EFGH12310
4123456ABCD001002EFGH1231.5
5123456LMNO001002EFGH12320
Sheet1


Sheet 2
Book2
ABCDEFGHIJ
1DateCompanyAccount TypeAccount NumberCompanyDept.LocationOwning CompanyOwning Dept.Total
211/14/2022ABCDLedger123456ABCD001002EFGH1235
311/14/2022ABCDLedger123456ABCD001002EFGH12310
411/14/2022ABCDLedger123456ABCD001002EFGH1231.5
Sheet2
Cell Formulas
RangeFormula
D2:J4D2=FILTER(Sheet1!$A$2:$G$5,Sheet1!$B$2:$B$5=Sheet2!$B$2,"No Match")
Dynamic array formulas.
 
Upvote 0
Solution

Forum statistics

Threads
1,223,909
Messages
6,175,312
Members
452,634
Latest member
cpostell

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