MATCH function

T1991

New Member
Joined
Oct 7, 2015
Messages
26
Office Version
  1. 2016
I have two sheets:
Master sheet
Supporting sheet
I am trying to pull any names from column G in Master to column C in Supporting but only if the row meets the following requirements:
The values in columns H, I and J in Master match the cells A11, B10 and A4 in Supporting.
I only want it to pull the first instance of the name and then move onto the next one. I have copied this formula as an array into C11:C20 in Supporting:
=IFERROR(INDEX(Master!$G$3:$G$100, MATCH(0, COUNTIF($C$10:C10, Master!$G$3:$G$100) + IF((Master!$H$3:$H$100=$A11)*(Master!$I$3:$I$100=B$10)*(Master!$J$3:$J$100=$A$4), 1, 0), 0)), "")

Additionally, I want to take a similar approach for column F in Supporting, where the match requirement will change from:
Master!$I$3:$I$100=B$10 to Master!$I$3:$I$100=E$10

However it just keeps pulling the same names from column C.

Any advice would be more than welcome. I have been on this for days 🤦🏼‍♂️
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
What version of Excel are you using?

I suggest that you update your Account details (or 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
What version of Excel are you using?

I suggest that you update your Account details (or 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’)
Apologies, it's 2016.
 
Upvote 0
Thanks for that. (y)
How about in C11 dragged down
Excel Formula:
=IFERROR(INDEX(Master!G:G,AGGREGATE(15,6,ROW(Master!$G$3:$G$100)/(Master!$H$3:$H$100=$A$11)/(Master!$I$3:$I$100=$B$10)/(Master!$J$3:$J$100=$A$4)/(ISNA(MATCH(Master!$G$3:$G$100,C$10:C10,0))),1)),"")
 
Upvote 0
Thanks for that. (y)
How about in C11 dragged down
Excel Formula:
=IFERROR(INDEX(Master!G:G,AGGREGATE(15,6,ROW(Master!$G$3:$G$100)/(Master!$H$3:$H$100=$A$11)/(Master!$I$3:$I$100=$B$10)/(Master!$J$3:$J$100=$A$4)/(ISNA(MATCH(Master!$G$3:$G$100,C$10:C10,0))),1)),"")
Thanks for responding.

So it pulls the first name from column G in Master, but not the next name. Every new entry in Master sits above the last one. I don't know if that's relevant?
 
Upvote 0
I have attached a picture of the layout...
 

Attachments

  • Picture1.png
    Picture1.png
    234.3 KB · Views: 12
Upvote 0
From what I can see it's pulling the last entry, not the 1st.
Check that the data in cols H, I & J are an exact match to the criteria.
 
Upvote 0
From what I can see it's pulling the last entry, not the 1st.
Check that the data in cols H, I & J are an exact match to the criteria.
Sorry, so the oldest entry, i.e. the first is the one on the bottom - Joe Bloggs. Newer entries automatically go on top via a User Form / VBA.

I have checked all of the columns and they do indeed match. I used a formula to double check the individual columns too.

Having such a nightmare with this sheet 🤦🏼‍♂️
 
Upvote 0
Sorry, so the oldest entry, i.e. the first is the one on the bottom
That doesn't change the fact that it is not pulling the 1st entry (ie the row 7)

Can you post some sample data.
MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
This is the Master sheet...

Template.xlsm
ABCDEFGHIJK
1 < Input data
2DEPARTMENTREQUEST IDPOSITION NUMBERSOURCEBACKFILL / ADDITIONALAPPROVED FROMFORMER ROLE OCCUPANTOU SHORT-CODECONTRACT TYPEEND DATE (MM/YY)MANAGER
3... | P
4... | PC
5... | PL
6... | PS
7… | PSEFGBackfillHJohn DoePSExec01/24
8... | PSABCBackfillDJoe BloggsPSExec01/24
9... | PP
10... | PM
11... | PI
12... | PV
Master


This is the Supporting sheet...

Template.xlsm
ABCDEFGHIJKLMNOP
1Budget:47Plan:47
2Memo:
3
401/24Non-payroll:
5AOR
6TotalsExecStaffIndirectDirectExternal
7
8
9
10ExecStaffIndirectDirectExternal
11PSJoe Bloggs
12
13
14
15
16
17
18
19
20
21PSK 
22PSS 
23PSX 
24QUERY 
Supporting
Cell Formulas
RangeFormula
C11,C21:C24C11=IFERROR(INDEX(Master!$G$3:$G$101,MATCH(1,(Master!$H$3:$H$101=$A11)*(Master!$I$3:$I$101=B$10)*(Master!$J$3:$J$101=$A$4),0)),"")
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,874
Messages
6,175,107
Members
452,613
Latest member
amorehouse

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