Solved

Excel COUNTIF sorting problem

Posted on 2015-02-20
9
244 Views
Last Modified: 2015-02-22
I have attached a file.  In sheet "1" and Sheet "2" I have several names in column A and random "X" in columns B thru V

In sheet "Curtis" I want to add all the Xs in curtis' row.  I know I can do this like this:  =COUNTIF('1'!B7:V7,"<>"&"") Since Curtis in on row 7 and it works fine.  

Now if I "Sort" the table on sheet "1" it messes all up.

How can I make it so if I sort the tables the equations still work??

I hope this makes sence.

Experts.xlsx
0
Comment
Question by:HDM
[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
  • 3
  • 3
9 Comments
 
LVL 59

Assisted Solution

by:Saurabh Singh Teotia
Saurabh Singh Teotia earned 250 total points
ID: 40621848
I believe this is what you are looking for...

Saurabh...
Experts.xlsx
0
 
LVL 22

Expert Comment

by:Ejgil Hedegaard
ID: 40621861
Use Index/Match instead of a specific row reference, like this
=COUNTIF(INDEX(Table1,MATCH($B6,Table1[Column1],0),),"x") for sheet "1" where the table is named Table1.

And =COUNTIF(INDEX(Table13,MATCH($B6,Table13[Column1],0),),"x") for the table (Table13) on sheet "2"
Count-in-table.xlsx
0
 

Author Comment

by:HDM
ID: 40621871
That does seem to work.

Thanks!!

Now, can you help me understand how it works so I can implement it??  :-)
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 59

Expert Comment

by:Saurabh Singh Teotia
ID: 40621887
HDM..

The way sum product works that it basically multiply the two numbers and then add those...

Now if you see the first condition it meets the answer is written in Boolean which is 0 or 1 and again if the condition is meet it return the answer again in Boolean and where both the conditions match it gives the answer as 1 and sum all of them as a process as a final result..

Go to formulas-->and evaluate formula to see how its working..let me know if this helps or you looking for more detail description...

Saurabh,,
0
 
LVL 22

Accepted Solution

by:
Ejgil Hedegaard earned 250 total points
ID: 40621912
The Match function looks at Column1, and finds the row matching the name.
Index without a column specification returns the entire row in the table.
Then Countif count the number of "x" in that row.
0
 

Author Comment

by:HDM
ID: 40623710
Ok, question, if this

=COUNTIF(INDEX(Table1,MATCH($B6,Table1[Column1],0),),"x")

returns values from a table called "1" and

=COUNTIF(INDEX(Table13,MATCH($B6,Table13[Column1],0),),"x")

retuns a value from the next table, what would I use to return a value from a table called "3" or the third table etc??
0
 
LVL 59

Expert Comment

by:Saurabh Singh Teotia
ID: 40623748
HDM..Did you had a look over the formula which i provided in the sheet?

Saurabh...
0
 

Author Comment

by:HDM
ID: 40623799
Yes but I am not totally understanding it.  I wll try more if it is to hard to explain.

Thanks!!
0
 
LVL 22

Expert Comment

by:Ejgil Hedegaard
ID: 40624392
Find the names at the formula tab, and use the appropriate one.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

737 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