# Excel Help with a formula

I have  a sheet that I need to do some counts on based on some text values.

I can count this way - =COUNTIF(B8:B12,"=n-****"). And I can count this way - =COUNTIF(E8:E12,"=p")+COUNTIF(E8:E12,"=t")+COUNTIF(E8:E12,"=e").

What I need to do is have something like this - IF(B8:B12,"=n-****")=COUNTIF(E8:E12,"=p")+COUNTIF(E8:E12,"=t")+COUNTIF(E8:E12,"=e")

Any help would be appreciated.
LVL 2
###### Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Business Systems Analyst , ex-Senior Application EngineerCommented:
I don't quite understand your problem, what is "n", "p", "t", "e", etc ?

Do you have a sample excel can upload and indicate your issue accordingly?
the n-**** is the id number
p = present
t = tardy
e = excused

so if the usersID = n-**** then count the cells that have "p" "t" & "e" in them
Here is a copy of the file
Church-Attendee-List-Plus---EE.xlsx
Business Systems Analyst , ex-Senior Application EngineerCommented:
I guess you need to use CountIFS to allow multiple criterion, like:

=COUNTIFS(\$B8:\$B14,"=n-****",D8:D14,"=p")
=COUNTIFS(\$B8:\$B14,"=n-****",D8:D14,"=t")
=COUNTIFS(\$B8:\$B14,"=n-****",D8:D14,"=e")

Church-Attendee-List-Plus---EEb.xlsx

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Commented:
You can do this by one formula by this..

=SUMPRODUCT((LEFT(\$B8:\$B14,1)="N")*((D8:D14="p")+(D8:D14="t")+(D8:D14="e")))

This will give you the same results about what you are looking for...

Saurabh...
Commented:
You could also use this formula to give a combined count

=SUM(COUNTIFS(\$B8:\$B14,"n-*",D8:D14,{"p","t","e"}))

regards, barry

Note: using "****" doesn't do anything different from using a single "*" because the * wildcard denotes any number of characters (even zero) anyway - if you specifically want to count instances which have "n-" followed by four characters you would use ? to denote a single character, e.g. "n-????"
Older than dirtCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.