CountIf on non contiguous named range

jakeyjake

New Member
Joined
Aug 8, 2017
Messages
2
Below is a set of data I am working on. I have named the customer satisfaction range as "CustomerSatisfaction" then i have applied a filter on the cities ie filter by "Melbourne" then i have named the customer satisfaction column with the filter on and called it "MelbourneCustomerSatisfaction". If i do a =CountIf(CustomerSatisfaction,5) named range, all works as expected, however if i do somethign like =CountIf(MelbourneCustomerSatisfaction, 2) it seems to just run is as =CountIf(CustomerSatisfaction,2) rather than apply the melbourne filter to it. Can anyone gimme a hand with this?

Recipt No.Payment typeCustomer's citySale price ($/ton)Delivery time (minutes/ton.km)Customer satisfaction
1EftposSydney3450.572
2chequeMelbourne4440.323
3EftposBrisbane4340.108
4chequeSydney3820.433
5EftposSydney4120.445
6EftposSydney4510.126
7EftposCanberra3580.337
8cashBrisbane3860.672
9cashSydney4070.575
10credit cardMelbourne3450.635
11credit cardMelbourne3900.344

<colgroup><col><col><col><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Could you go to name manager and see what the refers to part says for 'MelbourneCustomerSatisfaction'. Is it what you expect?
 
Upvote 0
Thanks for your response Steve.

You are right! The named range is not the range that I am after, it chooses random parts of the total column. not sure where excel chooses them from. Is there a way to filter the data and create a range using that filter? Im pretty new to excel so sorry for all the questions and very much appreciate your help.
 
Upvote 0
Welcome to the MrExcel board!

Do you really need to do the filtering?
What version of Excel are you using?

Assuming a reasonably recent version of Excel, here are a couple of options that may be of use.

First, if not done already, turn the data into a formal Excel table (via Insert ribbon tab).

Then you could ...

1. Use a formula like I have in cell H1 to count the Melbourne/2 rows, or

2. Create a Pivot Table (again on the Insert ribbon tab) to get all the City/Satisfaction counts.

Excel Workbook
ABCDEFGHIJKLMNOPQRS
1Recipt No.Payment typeCustomer's citySale price ($/ton)Delivery time (minutes/ton.km)Customer satisfaction0Count of Customer satisfactionCustomer satisfaction
21EftposSydney3450.572Customer's city2345678Grand Total
32chequeMelbourne4440.323Brisbane112
43EftposBrisbane4340.18Canberra11
54chequeSydney3820.433Melbourne1113
65EftposSydney4120.445Sydney11215
76EftposSydney4510.126Grand Total221311111
87EftposCanberra3580.337
98cashBrisbane3860.672
109cashSydney4070.575
1110credit cardMelbourne3450.635
1211credit cardMelbourne3900.344
Counts
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,872
Messages
6,122,026
Members
449,061
Latest member
TheRealJoaquin

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