Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can Excel count how many "10"'s are in a column?

Status
Not open for further replies.

FYRGUY

Technical User
Nov 27, 2005
42
US
I have a column, lets say "A" that I enter a number, lets say "10" (no quotes)that will return a text in column "B".

Can excel count how many "10"'s there are in a column but not count the actual number?
Example:
A B
10 On duty
10 On duty
12 Sick
15 Vacation
10 On duty

I want to know how many days this person was on duty?

Can anyone explain the formula to do this? Thank you in advance..

Chris
 
=countif(A:A,"10")

OR

=countif(B:B,"On duty")

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
A function which will do the job is Frequency. You insert the number, or numbers, or ranges you want to count into a Bins array and the data you are counting into a data array.

So for your sample up there you would use something like
C1 = FREQUENCY(A1:A5;D1) and put D1 = 10.

Change the array sizes and locations to suit.

 
DanFretwell,

Good thought, but that isn't what FREQUENCY is meant for. The "10" you placed in D1 in your example is the upper limit of a 'band' of values. Try entering a 5 into column A. The function will count it because it is less than 10.

Chris,

COUNTIF is what you're looking for.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
I don't wish to distract from Chris's original question, but since it has been brought up, I'd refer Dan to this page, which does a fine job explaining the how the FREQUENCY array function is to be used.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
Thank you for the info. Everyone on this site is so helpful, this has become such a great resource for me. Thank you

Chris
 
FYRGUY: [cheers]

DanFretwell,

Looking at your profile I see you're kind of new around here. I certainly hope I didn't discourage you from sticking around and throwing out answers whenever you think you know one.

This site is indeed a great place to learn. And a lot of that learning - for me, anyway - has come from following threads and seeing the answers posted by more experienced members.

Your contribution is appreciated.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
Thank you for that follow up Dan, I am not discouraged at all! I have often just logged on and read through some of the threads. I hope I can give input at some point.

Thanks again

Chris
 


Hi,

Just EXPANDING on the question, which is what an analyst does, if you really want to know not only how many 10s or On Dutys, but also how many of ALL the various values, you could use the PivotTable wizard, and in less than 5 seconds have that information as well...
[tt]
Count of Code
Code Total
10 3
12 1
15 1
Grand Total 5
[/tt]
CAVEAT: Must have column headings.

Skip,
[sub]
[glasses] [red]Be Advised![/red] For those this winter, caught in Arctic-like calamity, be consoled...
Many are cold, but few are frozen![tongue][/sub]
 
Skip,
This particular form I am working on is very small. I am trying to count only sick and vacation days and have them automatically subtract from a persons bank. I am trying to learn as much as possible and love browsing this site. Thanks for your input over the last few weeks!!

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top