Use a named range/table to lookup names in a countifs formula

Nixxy

New Member
Joined
Jun 20, 2019
Messages
1
Hi,

Hope someone can help.

I am trying to create a formula to lookup data in an input sheet and create a summary of key info and gap analysis.

the table looks simply as follows:

Input Table
REFRegionPMWave
Ref 1Region 1PM1Wave 1
Ref 2Region 1Wave 1
Ref 3Region 2PM3Wave 2
Ref 4Region 2PM4Wave 1
Ref 5Region 3PM5Wave 3
Ref 6Region 3PM1Wave 2
Ref 7Region 4PM2Wave 3
Ref 8Region 4PM1Wave 1
Ref 9Region 5PM4Wave 1
Ref 10Region 5PM5Wave 2

<tbody>
</tbody>
Output table
RegionNo PM
Region 11
Region 22
Region 31
Region 41
Region 52

<tbody>
</tbody>

<tbody>
</tbody>

<tbody>
</tbody>

the formula I am using is:
=COUNTIFS($C$30:$C$39,"<>",$D$30:$D$39,$H30,$E$30:$E$39,{"PM1","PM2","PM3","PM4","PM5"},$F$30:$F$39,"Wave 1")+COUNTIFS($C$30:$C$39,"<>",$D$30:$D$39,$H30,$E$30:$E$39,{"PM1","PM2","PM3","PM4","PM5"},$F$30:$F$39,"Wave 2")

Is there a way to combine all of the PMs into a table and count any person which is in that table/named range against the PM column in the input sheet? This means I can just add the name of a new PM to the table rather than having to alter the formula.

Thanks in advance for any help.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
I give you 2 options:


<table border="1" cellspacing="0" style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:76.04px;" /><col style="width:96px;" /><col style="width:76.04px;" /><col style="width:76.04px;" /><col style="width:76.04px;" /><col style="width:101.7px;" /><col style="width:76.04px;" /><col style="width:76.04px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td > </td><td >C</td><td >D</td><td >E</td><td >F</td><td >G</td><td >H</td><td >I</td><td >J</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >28</td><td style="background-color:#fafafa; font-family:Verdana; ">Input Table</td><td style="background-color:#fafafa; font-family:Verdana; "> </td><td style="background-color:#fafafa; font-family:Verdana; "> </td><td style="background-color:#fafafa; font-family:Verdana; "> </td><td > </td><td style="background-color:#fafafa; font-family:Verdana; ">Output table</td><td style="background-color:#fafafa; font-family:Verdana; "> </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >29</td><td style="background-color:#fafafa; font-family:Verdana; ">REF</td><td style="background-color:#fafafa; font-family:Verdana; ">Region</td><td style="background-color:#fafafa; font-family:Verdana; ">PM</td><td style="background-color:#fafafa; font-family:Verdana; ">Wave</td><td > </td><td style="background-color:#fafafa; font-family:Verdana; ">Region</td><td style="background-color:#fafafa; font-family:Verdana; ">No PM</td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >30</td><td style="background-color:#fafafa; font-family:Verdana; ">Ref 1</td><td style="background-color:#fafafa; font-family:Verdana; ">Region 1</td><td style="background-color:#fafafa; font-family:Verdana; ">PM1</td><td style="background-color:#fafafa; font-family:Verdana; ">Wave 1</td><td > </td><td style="background-color:#fafafa; font-family:Verdana; ">Region 1</td><td style="text-align:right; ">1</td><td style="text-align:right; ">1</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >31</td><td style="background-color:#fafafa; font-family:Verdana; ">Ref 2</td><td style="background-color:#fafafa; font-family:Verdana; ">Region 1</td><td style="background-color:#fafafa; font-family:Verdana; "> </td><td style="background-color:#fafafa; font-family:Verdana; ">Wave 1</td><td > </td><td style="background-color:#fafafa; font-family:Verdana; ">Region 2</td><td style="text-align:right; ">2</td><td style="text-align:right; ">2</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >32</td><td style="background-color:#fafafa; font-family:Verdana; ">Ref 3</td><td style="background-color:#fafafa; font-family:Verdana; ">Region 2</td><td style="background-color:#fafafa; font-family:Verdana; ">PM3</td><td style="background-color:#fafafa; font-family:Verdana; ">Wave 2</td><td > </td><td style="background-color:#fafafa; font-family:Verdana; ">Region 3</td><td style="text-align:right; ">1</td><td style="text-align:right; ">1</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >33</td><td style="background-color:#fafafa; font-family:Verdana; ">Ref 4</td><td style="background-color:#fafafa; font-family:Verdana; ">Region 2</td><td style="background-color:#fafafa; font-family:Verdana; ">PM4</td><td style="background-color:#fafafa; font-family:Verdana; ">Wave 1</td><td > </td><td style="background-color:#fafafa; font-family:Verdana; ">Region 4</td><td style="text-align:right; ">1</td><td style="text-align:right; ">1</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >34</td><td style="background-color:#fafafa; font-family:Verdana; ">Ref 5</td><td style="background-color:#fafafa; font-family:Verdana; ">Region 3</td><td style="background-color:#fafafa; font-family:Verdana; ">PM5</td><td style="background-color:#fafafa; font-family:Verdana; ">Wave 3</td><td > </td><td style="background-color:#fafafa; font-family:Verdana; ">Region 5</td><td style="text-align:right; ">2</td><td style="text-align:right; ">2</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >35</td><td style="background-color:#fafafa; font-family:Verdana; ">Ref 6</td><td style="background-color:#fafafa; font-family:Verdana; ">Region 3</td><td style="background-color:#fafafa; font-family:Verdana; ">PM1</td><td style="background-color:#fafafa; font-family:Verdana; ">Wave 2</td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >36</td><td style="background-color:#fafafa; font-family:Verdana; ">Ref 7</td><td style="background-color:#fafafa; font-family:Verdana; ">Region 4</td><td style="background-color:#fafafa; font-family:Verdana; ">PM2</td><td style="background-color:#fafafa; font-family:Verdana; ">Wave 3</td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >37</td><td style="background-color:#fafafa; font-family:Verdana; ">Ref 8</td><td style="background-color:#fafafa; font-family:Verdana; ">Region 4</td><td style="background-color:#fafafa; font-family:Verdana; ">PM1</td><td style="background-color:#fafafa; font-family:Verdana; ">Wave 1</td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >38</td><td style="background-color:#fafafa; font-family:Verdana; ">Ref 9</td><td style="background-color:#fafafa; font-family:Verdana; ">Region 5</td><td style="background-color:#fafafa; font-family:Verdana; ">PM4</td><td style="background-color:#fafafa; font-family:Verdana; ">Wave 1</td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >39</td><td style="background-color:#fafafa; font-family:Verdana; ">Ref 10</td><td style="background-color:#fafafa; font-family:Verdana; ">Region 5</td><td style="background-color:#fafafa; font-family:Verdana; ">PM5</td><td style="background-color:#fafafa; font-family:Verdana; ">Wave 2</td><td > </td><td > </td><td > </td><td > </td></tr></table><br /><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#fffcf9; color:#000000; "><tr><td ><b></b></td></tr><tr><td ><table border = "1" cellspacing="0" cellpadding="2" style="font-family:Arial; font-size:9pt;"><tr style="background-color:#cacaca; font-size:10pt;"><td >Cell</td><td >Formula</td></tr><tr><td >I30</td><td >=COUNTIFS($C$30:$C$39,"<>",$D$30:$D$39,$H30,$E$30:$E$39,"PM*",$F$30:$F$39,"Wave 1")+COUNTIFS($C$30:$C$39,"<>",$D$30:$D$39,$H30,$E$30:$E$39,"PM*",$F$30:$F$39,"Wave 2")</td></tr><tr><td >J30</td><td >=SUMPRODUCT(($C$30:$C$39<>"")*($D$30:$D$39=$H30)*(LEFT($E$30:$E$39,2)="PM")*(($F$30:$F$39="Wave 1")+($F$30:$F$39="Wave 2")))</td></tr></table></td></tr></table>
 
Upvote 0

Forum statistics

Threads
1,214,837
Messages
6,121,883
Members
449,057
Latest member
Moo4247

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