countif
Microsoft Office TrainingThe UK's Number 1 for Microsoft Office Training Sitemap add this page to your favourites/bookmarksBookmark page
 
view a printable version of this pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Countif

Countif

resolvedResolved · Low Priority · Version 2003

replyReplyMon 1 Mar 2010, 16:00Delegate Angelo said...

Countif

How do you count if for more than one if? Count if row1 = 1 AND row2<30?

For upcoming training course dates see: Pricing & availability

replyReplyMon 1 Mar 2010, 16:54Trainer Anthony said...

RE: countif

Hi Angelo, thanks for your query. The trick is to add up the two separate COUNTIF results. In this formula, the final result is the Sum of two COUNTIF formulas:

=(COUNTIF(A1:A16, ">15"))+(COUNTIF(B1:B16, ">15"))

Alternatively,

=Sum((COUNTIF(A1:A16, ">15")), (COUNTIF(B1:B16, ">15")))

Hope this helps,

Anthony

replyReplyTue 2 Mar 2010, 08:32Delegate Angelo said...

RE: countif

Suppose I have:
=(COUNTIF(A1:A16, ">15"))+(COUNTIF(B1:B16, ">15"))

How can this be generalised to count regardless of what number I choose for 15 without going into the code? In other words, How do I do the following:

=(COUNTIF(A1:A16, >C1))+(COUNTIF(B1:B16, >C2))

where C1 is any number I choose?

replyReplyWed 3 Mar 2010, 16:20Delegate Angelo said...

RE: countif

I think the solution you provided equates to counting if it satisfied one condition OR another condition. I need it to only count if it satisfies BOTH conditions.

This is what I have so far. I've relabeled the terms to what I'm actually doing:

Names Box:
Database=A1:B30
Disease=A1:A30
Age=B1:B30

Cells:
C1=0
C2=30
D1=COUNTIF(Disease,"="&C1)

but I need something that will take into account their age, something like:

=COUNTIF(Database,Disease=C1&Age<C2)

But that doesn't work...

replyReplyMon 8 Mar 2010, 14:23Trainer Anthony said...

RE: countif

Hi Angelo, sorry for the delay in replying. You need to put in, say, cell E1 the text >15 (without any quotes) and then reference cell E1 in your COUNTIF statements instead of putting ">15" as your criteria. Try that out and see how you get on.

Anthony

replyReplyMon 8 Mar 2010, 21:15Delegate Angelo said...

RE: countif

This is what I have so far. I've relabeled the terms to what I'm actually doing:

Names Box:
Database=A1:B30
Disease=A1:A30
Age=B1:B30

Cells:
C1="0"
C2="30"

So I have a column of peoples age (A1:A30) and a column of 1s and 0s for whether or not they have a disease.
I need to count how many people are under the age of 30 AND have the disease. Also, I need the function to refer to other cells that I can easily change the criteria from "under 30" to "under" any number I want. Or to change having the disease (1) to not having the disease (0). So the final function should look something like this:

D1=COUNTIF(Database,Disease=C1&Age<C2)

but this does not work. Any suggestions?

replyReplyTue 16 Mar 2010, 18:06Trainer Anthony said...

RE: countif

Hi Angelo, soryr for the delay in replaying - very busy training at the moment. With regards to your final function I'm a bit worried about the following:

Disease=C1&Age<C2

You appear to be trying to concatenate two separate functions here. Try using AND(Disease=C1, Age<C2) instead of the ampersand and put that into the COUNTIF statement. Let me know how you get on and whether you need any further assistance.

Anthony

Tue 23 Mar 2010: Automatically marked as resolved.

 

 

Please browse our web site to find out more about
microsoft+excel+training and other Microsoft training courses.

Excel tip:

Fill formulae across a sheet

To copy a formula down a spreadsheet where there is data underneath, to the left or to the right of the formula, double-click on the fill handle. The fill handle is the little black cross that appears in the bottom right-hand corner of the formula cell. Unfortunately, no similar facility exists to copy formulae across the sheet.

One reasonably quick way to copy an existing formula across a sheet is to select the formula and the cells on the right to which you want to copy it. Then press Ctrl+R to copy the formula across the selected range, or, if you are menu-minded, use the Edit|Fill|Right command.

View all Excel hints and tips

forum postI don't have one today!

» Forum post: Excel 2007


Rate this page:
2.2/5 (213 votes cast)
Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses
Microsoft Certified Partner
Security Seal verified by visa, mastercard securecard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Management training

Professional Skills courses
Project Management Course London
Project Management Courses London
Project Management Training London
Project Management Training
Project Seminar
Project Seminars
Time Management Course London
Time Management London
Time Management Courses London
Time Management Training London
Introduction to Finance course
Assertiveness Skills course
Effective Communications Skills training
Presentation Skills London

Training Formats

Public scheduled courses
On-site training
Closed company courses

Consultancy
Application Development

Blogs

Excel Training
MS Project Training
Microsoft Training Blog

Version differences

Office 2010 vs 2007
MS Project version differences

Training Information

London Computer Training
Computer Training London
Docklands Training Courses
Docklands Training London

Training venues London
Client list
FAQ
Pricing and availability
Course details / Syllabus

Training Articles
Training Information

Microsoft training

Microsoft Office training
& IT Applications

Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training
MS Project courses
MS Project training
Outlook courses
PowerPoint courses
PowerPoint training
VBA courses
Word courses
Microsoft.training
(more...)

Excel Training

Excel courses
Excel Training Courses Medway
Autonumber in Excel
Microsoft Excel training
Basic Excel Courses
Basic Excel Course
Basic Excel Training

Interested in MS Access training?

Access courses
Microsoft Access training
Microsoft access courses
Microsoft training access course
Microsoft+access+training
Access courses in london

Training provider

Training providers
IT training companies
IT training providers
Management Training providers
Management Training provider

Event history, feedback results
Events in 2012 · 2011 · 2010 · More

See also

Crystal Reports training