Index and Match for four columns.

rgillson3

Board Regular
Joined
Oct 3, 2013
Messages
132
Office Version
  1. 365
Platform
  1. Windows
I work with a report that requires a lot of filtering.

I've been using an Index-Match formula in two different columns to fill in filterable data.

Currently, Column K Indexes Col N, to Match Col O, and Col M Indexes Col Q to Match Col R.

How can I have one column Index do both?

I ran across the Index-Match-Match formula, but am not sure if it would work, or how to set it up.
 
I think I figured out how to use the xl2bb extension.

Index Test.xlsx
IJKLMNOPQR
1Mgr20
2Mgr21NON EMP40
329.61Mgr22NON EMP41
4Mgr23NON EMP42
5HAVE TO leave the "Yes" in this formulaMgr24NON EMP43
6Mgr25
7Cell contains only a space: /NOMgr26
8NoNO ot#N/A#N/A#N/AMgr27
9Mgr28
10Mgr29
11Blank?OT?MgrMgr NameTo Go/Off-SiteMgr30
12
13YesOT?#N/A#N/A#N/A
14YesOT?#N/A#N/A#N/A
15YesOT?#N/A#N/A#N/A
16YesOT?#N/A#N/A#N/A
17NoNO ot#N/A#N/A#N/A
18YesNO ot#N/A#N/A#N/A
OT Report WE 08.20.2023_Fri (2)
Cell Formulas
RangeFormula
I3I3=MAX(C13:C438)
R3:R5,O2:O11R3=+R2+1
I8,I13:I18I8=IF(A8=" ","Yes","No")
J8,J13:J18J8=IF(C8>$G$2,"OT?","NO ot")
K8,K13:K18K8=INDEX($N$1:$N$11,MATCH(A8,$O$1:$O$11,0))
L8,L13:L18L8=IF(K8="Mgr",A8,"")
M8,M13:M18M8=INDEX($Q$1:$Q$11,MATCH(A8,$R$1:$R$11,0))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K13:K579Expression=K13="Mgr"textNO
Hello,

The xl2bb does not have values in cells (columns A-H are absent), so I had to put something in to try to work this. I cant see how using Match to a cell in column A in your indexes will return the result that you want (Column O's values = 20-30 Match to A17 and Column R values = 40-43 Match to A17) since both cannot be true with the example data you provided, I can only assume your real data will be able to Match A17 to the real values in these columns. If you want both Index & Match(es) to work consecutively, try the formula below for text with a space between both results. I cant check how this works due to the issue with no Columns A-H data in the mini sheet and both Match(es) to the same cell (A) cannot be True with the values in Columns O & R.

=(INDEX($N$1:$N$11,MATCH(A17,$O$1:$O$11,0))&" "&INDEX($Q$1:$Q$11,MATCH(A17,$R$1:$R$11,0)))

Book1
ABCDEFGHIJKLMNOPQRS
1Mgr20
23Mgr21NON EMP40
30Mgr22NON EMP41
4Mgr23NON EMP42
5HAVE TO leave the "Yes" in this formulaMgr24NON EMP43
6Mgr25
7Cell contains only a space: /NOMgr26
83087NoOT?Mgr30#N/AMgr27
9Mgr28
10Mgr29
11Blank?OT?MgrMgr NameTo Go/Off-SiteMgr30
12
136DataDataNoOT?#N/A#N/A#N/A
1429DataDataNoOT?Mgr29#N/A
1528DataDataNoOT?Mgr28#N/A
1627DataDataNoOT?Mgr27#N/A
1726DataDataNoOT?Mgr26#N/A#N/A
1825DataDataNoOT?Mgr25#N/A
19
20
Sheet1
Cell Formulas
RangeFormula
I3I3=MAX(C13:C438)
R3:R5,O2:O11R3=+R2+1
I8,I13:I18I8=IF(A8=" ","Yes","No")
J8,J13:J18J8=IF(C8>$G$2,"OT?","NO ot")
K8,K13:K18K8=INDEX($N$1:$N$11,MATCH(A8,$O$1:$O$11,0))
L8,L13:L18L8=IF(K8="Mgr",A8,"")
M8,M13:M18M8=INDEX($Q$1:$Q$11,MATCH(A8,$R$1:$R$11,0))
Q17Q17=(INDEX($N$1:$N$11,MATCH(A17,$O$1:$O$11,0))&" "&INDEX($Q$1:$Q$11,MATCH(A17,$R$1:$R$11,0)))
 
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Assuming the lookup value will be in either Column O or R, try this:
Excel Formula:
=XLOOKUP(A17, $O$1:$O$11, $N$1:$N$11, XLOOKUP(A17, $R$1:$R$11, $Q$1:$Q$11, ""))

Note: The Xlookup Format is below and the 2nd Xlookup is in the "if_not_found" position of the 1st Xlookup.
=XLOOKUP( lookup_value, lookup_array, return_array, if_not_found )
 
Upvote 0
Solution

Forum statistics

Threads
1,215,084
Messages
6,123,029
Members
449,092
Latest member
ikke

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