Xlookup help

zinah

Active Member
Joined
Nov 28, 2018
Messages
368
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have below table and what I need is to get the count based on selected team for each tenure, I was trying to use the xlookup but it's not working, as it's giving me #VALUE, can anyone help me with refining the formula to get the same as expected results column?

Xlookup help.xlsx
ABCDEFGHIJ
1Team1Team2Team3Team4
2TenureCountCountCountCount
3> 10 Yrs761173
45-10 Yrs941149
52-5 Yrs1539282
61-2 Yrs523122
7< 1 Yr11740
8< 2 MonthsNANA8
9< 6 MonthsNA8NA
10Team1
11Expected results
12TenureCount
13> 10 Yrs7#VALUE!
145-10 Yrs9
152-5 Yrs15
161-2 Yrs5
17< 1 Yr11
18< 2 MonthsNA
19< 6 MonthsNA
20
Sheet1
Cell Formulas
RangeFormula
I13I13=XLOOKUP(1,(B1:E1=G10)*(A3:A9=G13),B3:E9)
Cells with Data Validation
CellAllowCriteria
G10List=$B$1:$E$1
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
The array sizes don't match - so it will throw an error. Index Match might be better.
MrExcelPlayground23.xlsx
ABCDEFGHI
1Team1Team2Team3Team4
2TenureCountCountCountCount
3> 10 Yrs761173
45-10 Yrs941149
52-5 Yrs1539282
61-2 Yrs523122
7< 1 Yr11740
8< 2 MonthsNANA8
9< 6 MonthsNA8NA
10Team2
11Expected results
12TenureCount
13> 10 Yrs761
145-10 Yrs941
152-5 Yrs1539
161-2 Yrs523
17< 1 Yr117
18< 2 MonthsNANA
19< 6 MonthsNA8
Sheet2
Cell Formulas
RangeFormula
I13:I19I13=INDEX($B$3:$E$9,XMATCH($G13,$A$3:$A$9,0),XMATCH($G$10,$B$1:$E$1,0))
 
Upvote 0
Another option.
Book1 (version 1).xlsb
ABCDEFGHI
1Team1Team2Team3Team4
2TenureCountCountCountCount
3> 10 Yrs761173
45-10 Yrs941149
52-5 Yrs1539282
61-2 Yrs523122
7< 1 Yr11740
8< 2 MonthsNANA8
9< 6 MonthsNA8NA
10Team1
11Expected results
12TenureCount
13> 10 Yrs77
145-10 Yrs99
152-5 Yrs1515
161-2 Yrs55
17< 1 Yr1111
18< 2 MonthsNANA
19< 6 MonthsNANA
Sheet6
Cell Formulas
RangeFormula
I13:I19I13=TOCOL(IFS(G13:G19&G10=A3:A9&B1:E1,B3:E9),2)
Dynamic array formulas.
 
Upvote 0
Solution
The array sizes don't match - so it will throw an error. Index Match might be better.
MrExcelPlayground23.xlsx
ABCDEFGHI
1Team1Team2Team3Team4
2TenureCountCountCountCount
3> 10 Yrs761173
45-10 Yrs941149
52-5 Yrs1539282
61-2 Yrs523122
7< 1 Yr11740
8< 2 MonthsNANA8
9< 6 MonthsNA8NA
10Team2
11Expected results
12TenureCount
13> 10 Yrs761
145-10 Yrs941
152-5 Yrs1539
161-2 Yrs523
17< 1 Yr117
18< 2 MonthsNANA
19< 6 MonthsNA8
Sheet2
Cell Formulas
RangeFormula
I13:I19I13=INDEX($B$3:$E$9,XMATCH($G13,$A$3:$A$9,0),XMATCH($G$10,$B$1:$E$1,0))
Thanks soooo much, it's my first time to get to know the XMATCH, I'll use your formula in other filed and the other suggested formula by @Cubist to familiarize myself more with xmatch!
 
Upvote 0
Another option.
Book1 (version 1).xlsb
ABCDEFGHI
1Team1Team2Team3Team4
2TenureCountCountCountCount
3> 10 Yrs761173
45-10 Yrs941149
52-5 Yrs1539282
61-2 Yrs523122
7< 1 Yr11740
8< 2 MonthsNANA8
9< 6 MonthsNA8NA
10Team1
11Expected results
12TenureCount
13> 10 Yrs77
145-10 Yrs99
152-5 Yrs1515
161-2 Yrs55
17< 1 Yr1111
18< 2 MonthsNANA
19< 6 MonthsNANA
Sheet6
Cell Formulas
RangeFormula
I13:I19I13=TOCOL(IFS(G13:G19&G10=A3:A9&B1:E1,B3:E9),2)
Dynamic array formulas.
Thank you soooo much! Thanks for introducing me to TOCOL formula, I believe it's very helpful and straightforward!
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,150
Members
453,021
Latest member
Justyna P

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