Spans and Layers with condition

zinah

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

I'm trying to create spans and layers and I was able to do that, however, I need to create a new span and layers with condition below:
If management chain level 2 = Manager C or Manager G or Manager J, then exclude the count, do you have any suggestions for suitable formula? the current formula is = COUNTIF(C3:C102,"")

Layers under Management Level.xlsx
ABCDEFGHIJKLMNOPQRSTUV
1Employee Report DataSummarization Table
2Employee IDManagement Chain - Level 02Management Chain - Level 03Management Chain - Level 04Management Chain - Level 05Management Chain - Level 06Management Chain - Level 07Management Chain - Level 08Management Chain - Level 02Spans/LayersManagement Chain - Level 03Management Chain - Level 04Management Chain - Level 05Management Chain - Level 06Management Chain - Level 07Management Chain - Level 08
31Manager AEmployeeEmployeeEmployeeEmployeeEmployeeEmployeeManager A64478910
42Manager BEmployeeManager B6101111121314
53Manager CEmployeeEmployeeEmployeeManager C5233667
64Manager DEmployeeEmployeeManager D4224566
75Manager EEmployeeEmployeeEmployeeManager E4255788
86Manager FEmployeeEmployeeEmployeeEmployeeManager F4344488
97Manager GEmployeeEmployeeEmployeeManager G3377888
108Manager HManager H0888888
119Manager IEmployeeEmployeeEmployeeEmployeeManager I445881010
1210Manager JManager J0888888
1311Manager KEmployeeEmployeeEmployeeEmployeeEmployeeEmployeeManager K6568888
1412Manager AEmployeeEmployee
1513Manager BEmployeeEmployeeEmployeeEmployee
1614Manager CEmployeeEmployeeEmployee
1715Manager DEmployeeEmployeeEmployee
1816Manager EEmployeeHC under each layer
1917Manager FEmployeeEmployeeEmployeeEmployeeCEO - 11
2018Manager GEmployeeCEO - 28
2119Manager HCEO - 351
2220Manager IEmployeeEmployeeEmployeeEmployeeCEO - 463
2321Manager JCEO - 573
2422Manager KEmployeeEmployeeCEO - 682
2523Manager AEmployeeEmployeeCEO - 792
2624Manager BEmployeeEmployeeEmployeeEmployeeEmployeeCEO - 895
2725Manager CEmployeeEmployeeEmployeeEmployeeEmployee
2826Manager DEmployeeEmployeeEmployeeEmployee
2927Manager EEmployeeEmployeeEmployee
3028Manager FEmployeeEmployeeEmployeeEmployee
3129Manager GEmployee
3230Manager H
3331Manager IEmployeeEmployee
3432Manager J
3533Manager KEmployeeEmployee
3634Manager AEmployeeEmployee
3735Manager BEmployeeEmployeeEmployee
3836Manager CEmployeeEmployeeEmployee
3937Manager DEmployeeEmployee
4038Manager EEmployee
4139Manager FEmployeeEmployeeEmployeeEmployee
4240Manager GEmployee
4341Manager H
4442Manager IEmployeeEmployee
4543Manager J
4644Manager KEmployeeEmployeeEmployeeEmployeeEmployeeEmployee
4745Manager EEmployee
4846Manager F
4947Manager GEmployee
5048Manager H
5149Manager IEmployeeEmployee
5250Manager J
5351Manager KEmployeeEmployeeEmployeeEmployeeEmployeeEmployee
5452Manager AEmployeeEmployeeEmployeeEmployeeEmployee
5553Manager A
5654Manager AEmployeeEmployeeEmployeeEmployee
5755Manager A
5856Manager AEmployeeEmployeeEmployee
5957Manager A
6058Manager A
6159Manager B
6260Manager B
6361Manager B
6462Manager BEmployeeEmployeeEmployeeEmployeeEmployeeEmployee
6563Manager B
6664Manager B
6765Manager B
6866Manager B
6967Manager B
7068Manager B
7169Manager B
7270Manager CEmployee
7371Manager C
7472Manager C
7573Manager D
7674Manager D
7775Manager E
7876Manager F
7977Manager G
8078Manager H
8179Manager I
8280Manager J
8381Manager K
8482Manager EEmployeeEmployeeEmployeeEmployee
8583Manager FEmployee
8684Manager G
8785Manager H
8886Manager IEmployee
8987Manager J
9088Manager K
9189Manager E
9290Manager F
9391Manager G
9492Manager H
9593Manager I
9694Manager J
9795Manager K
9896Manager K
9997Manager K
10098Manager KEmployee
10199Manager I
102100Manager I
Sheet1
Cell Formulas
RangeFormula
O3:O13O3=MAX(MMULT(($B$3:$B$1000=N3)*($C$3:$H$1000<>""),SEQUENCE(6,,,0)))
P3:U13P3=COUNTIFS($B$3:$B$102,$N3,C$3:C$102,"")
O20O20=COUNTA(N3:N13)-3
O21O21=COUNTIF(C3:C102,"")
O22O22=COUNTIF(D3:D102,"")
O23O23=COUNTIF(E3:E102,"")
O24O24=COUNTIF(F3:F102,"")
O25O25=COUNTIF(G3:G102,"")
O26O26=COUNTIF(H3:H102,"")
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Do you mean something like =COUNTIFS(C3:C102,"",B3:B102,"<>Manager C",B3:B102,"<>Manager G",B3:B102,"<>Manager J")?
 
Upvote 0
Do you mean something like =COUNTIFS(C3:C102,"",B3:B102,"<>Manager C",B3:B102,"<>Manager G",B3:B102,"<>Manager J")?
Thanks a lot for your great formula! what about if I need to use unique formula to populate managers list based on specific manager that they report to? i.e. in below table, I need to list the managers that reports to manager 1 only and exclude managers that report to manager 2? The end result should be the last column

Layers under Management Level.xlsx
MNOP
31Management Chain - Level 01Management Chain - Level 02Unique FormulaManagers under Manager 1
32Manager 1Manager AManager AManager A
33Manager 1Manager BManager BManager B
34Manager 2Manager CManager CManager D
35Manager 1Manager DManager DManager E
36Manager 1Manager EManager EManager F
37Manager 1Manager FManager FManager H
38Manager 2Manager GManager GManager I
39Manager 1Manager HManager HManager K
40Manager 1Manager IManager I
41Manager 2Manager JManager J
42Manager 1Manager KManager K
Sheet1
Cell Formulas
RangeFormula
O32:O42O32=UNIQUE(B3:B102)
Dynamic array formulas.
 
Upvote 0
Something like this?
Book24
MNOP
31Management Chain - Level 01Management Chain - Level 02Unique FormulaManagers under Manager 1
32Manager 1Manager AManager AManager A
33Manager 1Manager BManager BManager B
34Manager 2Manager CManager CManager D
35Manager 1Manager DManager DManager E
36Manager 1Manager EManager EManager F
37Manager 1Manager FManager FManager H
38Manager 2Manager GManager GManager I
39Manager 1Manager HManager HManager K
40Manager 1Manager IManager I
41Manager 2Manager JManager J
42Manager 1Manager KManager K
Sheet1
Cell Formulas
RangeFormula
P32:P39P32=FILTER(N32:N42,M32:M42="Manager 1")
Dynamic array formulas.
 
Upvote 1
Solution

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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