?
Solved

Excel 2010 Countif problem

Posted on 2014-12-19
9
Medium Priority
?
150 Views
Last Modified: 2014-12-24
I can’t get my spreadsheet to count up the number of Z jobs.  I tried several different variations of the formula, but if there is more than 1 job in a cell, it only counts it once.  I can’t figure out how to get Excel to count all the Z jobs.
ZZZ-Job.xlsx
0
Comment
Question by:WalterAPO
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 2000 total points
ID: 40509352
As long as the Z can't appear anywhere else in the cell contents, you can use:
=SUM((INDEX(LEN(A2:A111)-LEN(SUBSTITUTE(A2:A111,"Z","")),)))
0
 
LVL 1

Expert Comment

by:neel_7575
ID: 40509440
Do a Find - Replace All - Look for "Z", Replace with "A" or something - Excel does the Replace and gives the no. of instances replaced. Then just do an Undo, to get back the original cells
0
 

Author Comment

by:WalterAPO
ID: 40509450
The above formula is a little complicated.  I need a formual, (replace all won't work), that I can show my coworkers.  If it's too complicated they wont' use it.  Can I add a - or / between the Z job numbers to get them to count?  For this formual simple is better.   Thank you.  

Walter
0
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
LVL 1

Expert Comment

by:neel_7575
ID: 40509465
Your existing formula can still work - Just do a Text to Columns - to have the Z Jobs in individual cells - Delimiter being Comma
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 40509476
If you want a simple formula you need a simple data layout.
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 40509496
In your sample, all jobs within each cell start with Z. Will this always be the case?

If so, this simple formula in column C will tell you how many jobs are in the cell in column A:

=IF(A6="",0,(LEN(A6)-LEN(SUBSTITUTE(A6,",","")))+1)

You can then just SUM column C to find out how many jobs in total.

The formula is looking at the total length of the characters in the cell and then working out the length without the commas; one less the other plus 1 tells you how many entries (plus 1 because last entry doesn't have a comma after it).

Thanks
Rob H
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 40509503
Not quite as simple, and certainly not as easily explained to other users, you can use the following Array Formula in C3 with no need for other entries in column C:

=SUM(IF(A6:A82="",0,(LEN(A6:A82)-LEN(SUBSTITUTE(A6:A82,",","")))+1))

Confirm entry with Shift + Ctrl + Enter and curly brackets  {  } will appear enclosing the formula.

Thanks
Rob H
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 40510922
Probably simpler to use Z in the substitute function, like Rory did, then don't need the +1 at the end.
0
 

Author Closing Comment

by:WalterAPO
ID: 40517057
Thank you your solution worked great.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question