Countif using totals of two named columns

PatRichard

New Member
Joined
Dec 29, 2018
Messages
28
Office Version
  1. 365
Platform
  1. Windows
I'm trying to use countif to figure out how many rows have two cells that added together are greater than another value. I know for a single column, something like
Excel Formula:
=COUNTIF(SiteInfo[Number of Users],"<"&Data!E51)
works fine. But I want the sum of SiteInfo[Number of Users] + SiteInfo[Shared Devices] as the criteria, and just can't seem to find something that works. The closest I've come is counting the number of rows where either cell is < Data!E51. Thoughts?

1719980730506.png
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Try:
Excel Formula:
=SUM(--(SiteInfo[Number of Users] + SiteInfo[Shared Devices] <Data!E51))
 
Upvote 0
No, that's not valid. I need to know the number of rows (countif) where the total of the two cells is < Data!E51 (currently 25).
 
Upvote 0
The formula does exactly that. Did you try it? If you get result different than what you're expecting can you post a sample data in a copyable format for testing?
 
Upvote 0
The formula does exactly that. Did you try it? If you get result different than what you're expecting can you post a sample data in a copyable format for testing?
I got 95 when testing your formula with a sample of 22 rows. It should be 18.

Site nameNumber of UsersShared Devices
Airport
4​
2​
Animal Control
6​
5​
City Hall
188​
31​
Tudor Pump Station
0​
0​
Fire Station 1 (HQ)
13​
27​
Fire Station 2
0​
9​
Fire Station 3
0​
10​
Fire Station 4
0​
4​
Fire Station 4 (old)
2​
0​
Fire Station 5
0​
3​
Fire Station 6
0​
7​
Fire Station 7
0​
12​
Community Center
2​
2​
Community Center & Waves
4​
4​
Park
0​
1​
Community Center & Ampitheatre
5​
6​
Community Center 2
5​
2​
Parks Maintenance
5​
0​
Police & Courts
104​
39​
Public Works Operations & Fleet Maintenance
18​
3​
Water Department
39​
7​
Water Operations (old)
0​
0​
 
Upvote 0
I am getting 18.
Book1
ABCDE
1Site nameNumber of UsersShared Devices
2Airport4218
3Animal Control65
4City Hall18831
5Tudor Pump Station00
6Fire Station 1 (HQ)1327
7Fire Station 209
8Fire Station 3010
9Fire Station 404
10Fire Station 4 (old)20
11Fire Station 503
12Fire Station 607
13Fire Station 7012
14Community Center22
15Community Center & Waves44
16Park01
17Community Center & Ampitheatre56
18Community Center 252
19Parks Maintenance50
20Police & Courts10439
21Public Works Operations & Fleet Maintenance183
22Water Department397
23Water Operations (old)00
Sheet2
Cell Formulas
RangeFormula
E2E2=SUM(--(B2:B23+C2:C23<25))
 
Upvote 0
I am getting 18.
I see what's happening. The table has 100 rows total. a bunch of which are empty rows, so those are getting counted. So I'll need to work around that. Deleting the empty rows isn't going to be a solution. But at least you've got me headed in the right direction.
 
Upvote 0
I see what's happening. The table has 100 rows total. a bunch of which are empty rows, so those are getting counted. So I'll need to work around that. Deleting the empty rows isn't going to be a solution. But at least you've got me headed in the right direction.
Are the rows truly empty or are they empty strings "" e.g. returned from a formula?
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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