0

I have a list of employees where the Name, Department and Years of Experience is stated

Name    Department  Years of Experience
John    HR                  5
Mary    Finance             12
Tom     HR                  6
Dick    Finance             11
Sally   HR                  8
Harry   Finance             10
Tim     HR                  8
Duke    Finance             9
Simon   HR                  9
Dolly   Finance             2

Reference to the list of Employees

I wish to write a formula where I could input the Department and Years of Experience to serve as a searching criteria - for example: "HR" and "6" Input Criteria

Search Department:  HR
Years of Experience:    6

The results that I am hoping to get would be the Name, Department, and Years of Experience sorted based on how close the employee's experience is based on the searched department.

For example: I searched "HR" and "6", the result will be ordered: Displaying of Results

Name    Department  Years of Exp
Tom        HR            6
John       HR            5
Sally      HR            8
Tim        HR            8
Simon      HR            9
Nimantha
  • 6,405
  • 6
  • 28
  • 69
Edwin
  • 1
  • 1

4 Answers4

2

array formula:

=IFERROR(INDEX(A:A,RIGHT(SMALL(IF($B$2:$B$11="HR",($C$2:$C$11-6)^2/1%%+ROW($2:$11)),ROW(A1)),2)),"")

enter image description here

SeeRain
  • 76
  • 2
0

FILTER function

try having the formula using the FILTER function just change the ranges as applied to your worksheet

=FILTER(B22:D32,C22:C32="HR")
Nimantha
  • 6,405
  • 6
  • 28
  • 69
12Rev79
  • 166
  • 1
  • 6
0

This can easily be done, using the autofilter basic feature of Excel, why not use that:

enter image description here

Dominique
  • 16,450
  • 15
  • 56
  • 112
0

Option for O365:

=LET(sorted,SORTBY(A2:C11,ABS(C2:C11-G2),1),FILTER(sorted,(INDEX(sorted,0,2)=G1)*(INDEX(sorted,0,3)>=G2-3)*(INDEX(sorted,0,3)<=G2+3)))

enter image description here

basic
  • 11,673
  • 2
  • 9
  • 26