Counting cells with different values

t2true

New Member
Joined
Dec 2, 2015
Messages
36
Office Version
  1. 2016
Platform
  1. Windows
Spreadsheet lists used and unused ports. Unused ports are identified with a “p”. Used ports show the port number:

Pp
3​
ppp
7​
8​
9​
ppppp
15​
ppppppp
23​
p
pp
3​
4​
p
6​
pppppppppppppppp
23​
p
pppppppp
9​
pp
12​
pppppp
19​
p
21​
22​
pp
pp
3​
pp
6​
7​
p
9​
10​
p
12​
13​
14​
15​
16​
p
18​
p
20​
p
22​
p
24​
1​
2​
3​
4​
p
6​
7​
p
9​
ppp
13​
p
15​
p
17​
18​
p
20​
21​
22​
p
24​
p
2​
3​
4​
p
6​
7​
p
9​
pp
12​
13​
pppp
18​
19​
20​
u
22​
23​
p
1​
pppp
6​
p
8​
9​
p
11​
12​
13​
p
15​
p
17​
p
19​
20​
21​
pp
24​
ppp
4​
pppppp
11​
12​
13​
p
15​
16​
17​
p
19​
20​
ppp
24​
p
2​
p
4​
5​
p
7​
8​
ppppppp
16​
ppp
20​
pp
23​
p
pppppppppppppppppppppppp


At the end of each row needs to show total for used and unused. I am using =COUNTIF(A1:A24,"p") to find unused. But, I do not know how to find used ports since the value in each cell is different. Maybe a formula to count cells that do not have “p”?



Thank you
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
From your formula, it appears you want to show totals for each column, not each row. In that case maybe'

=COUNTA(A1:A24)- COUNTIF(A1:A24,"p")

for used ports.
EDIT: Note that this formula excludes counting any blank cells in the column.
 
Upvote 0
Do you mean at the end of each column?
If so try
=COUNTIF(A1:A24,"<>p")
 
Upvote 0
Yes. Adding the <> did the trick. Thank you all for your help.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,055
Messages
6,122,902
Members
449,097
Latest member
dbomb1414

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