+ Reply to Thread
Results 1 to 17 of 17

COUNTA for Indexed cells without solving for the index

  1. #1
    Forum Contributor
    Join Date
    06-18-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    104

    COUNTA for Indexed cells without solving for the index

    My title may be a bit ambiguous. I'm going to try and explain this as thorougly as possible but it is a bit difficult to describe with confidential information. I have about 3000 records so I'll try to make a simple example:

    I have a column "Direct to Branch" and then I also a column for "Client." Under "Direct to Branch," I have option A, B, or C and this is for all of the data. However, I need to solve for the amount of As, Bs, Cs and the total when I filter by client. I would not normally have an issue if I could keep the data filtered but I need to do the same thing for every client so I'm trying to do this process without filtering.

    so far, I have the equation (for the count of all As, Bs, and Cs):

    =COUNTA(INDEX('DIRECT TO BRANCH'!A1:A100, MATCH ("CLIENT NAME", 'CLIENT'!B1:B100,0)))

    but it is only giving the number 1 as a result because it is only one index. Any help or if I can provide a better description, please let me know. Thank you!

    Scott B.

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: COUNTA for Indexed cells without solving for the index

    not knowing how your data is setup, it sounds like a pivot table make work for you....can you upload a sample using fake info?....maybe I can help
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: COUNTA for Indexed cells without solving for the index

    Are you trying to do a COUNTIF on a filtered table?

    You want to COUNTIF column A = "A", "B", or "C" when filtered?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Contributor
    Join Date
    06-18-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    104

    Re: COUNTA for Indexed cells without solving for the index

    yeah let me try to make one really quick

  5. #5
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Re: COUNTA for Indexed cells without solving for the index

    Try using:

    =COUNTIFS(A:A,"A",B:B,"Harribone")

    This will return the number of matches when Col A ="A" and Col B ="Harribone".

    Hope this helps you
    Say thanks, click *

  6. #6
    Forum Contributor
    Join Date
    06-18-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    104

    Re: COUNTA for Indexed cells without solving for the index

    I was actually just looking at that. I've never used COUNTIFS before; I've only used COUNTIF. I'll make a sample spreadsheet to see if that works or not.

  7. #7
    Forum Contributor
    Join Date
    06-18-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    104

    Re: COUNTA for Indexed cells without solving for the index

    COUNTIFS worked for a specific branch to be directed to. How would I count the total for a specific client without filtering?

    I attached a spreadsheet which is quite bare bones of what I'm working on.

    And in response to the pivot tables comment, my company is actually using them and everything, but they wanted me to fix these equations so I can present percentages so that an Average Joe could understand what the data means. I completely agree though.
    Attached Files Attached Files

  8. #8
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Re: COUNTA for Indexed cells without solving for the index

    With your example data:

    =COUNTIFS(A:A,"A",B:B,"Client 1")

    would give you the total number of rows where Direct to Branch is A and Client Name is Client 1 (answer is 6).
    If you use =COUNTIF(B:B,"Client 1") instead that would tell the total number of entries for Client 1 (answer 32) if that is what you areloking for.

    The formulas above have the "A" and "Client 1" typed in directly but you can replace these with cell references (A1 A2 X99 for eg) and in those cells you can type Client 1 etc instead of changing your formula each time.

    Is this what you're getting at? If not can you give an example which relates to the file you uploaded please and what the answer should be. We can then provide another solution to help you out.

  9. #9
    Forum Contributor
    Join Date
    06-18-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    104

    Re: COUNTA for Indexed cells without solving for the index

    Well the problem with what I'm working on is it gets a little more complicated. I'm going to attach a different spreadsheet that is a little more complex because there is another column involved and the "Direct to Branch" column values depend on it. I'll post it in a minute

  10. #10
    Forum Contributor
    Join Date
    06-18-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    104

    Re: COUNTA for Indexed cells without solving for the index

    Okay so to provide a little bit about what's going on now, I changed the previous branch "C" to blank because that is what it's like on this spreadsheet I'm working on. However, I do not want to have =COUNTIFS (C:C, "", D:D,"Client 1") because that would count all of the blanks when really every order should not be counted. Only the transfers should be counted but I also want to count the pending ones because they will be transferred at some point, but they also have a blank for the final allocation. Does that sort of make sense?
    Attached Files Attached Files

  11. #11
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Re: COUNTA for Indexed cells without solving for the index

    =COUNTIFS(D:D,"Client 1",B:B,"PENDING")+COUNTIFS(D:D,"Client 1",B:B,"complete")

    Is this gettingcloser to what you need? This doesn't include the Branch column this time but you can add this to each countifs within the formula if needed.

  12. #12
    Forum Contributor
    Join Date
    06-18-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    104

    Re: COUNTA for Indexed cells without solving for the index

    It's getting closer. However the only problem I have is that the spreadsheet I'm working with doesn't say PENDING. Imagine it as a description box but meaning the same thing. The issue with this is that all of the descriptions are different. But, if there is a description, then it is pending. Does this make sense?

  13. #13
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Re: COUNTA for Indexed cells without solving for the index

    Ah I see. Using your example sheet do the following:

    In E2 type =IF(B2="","","x") and drag down. Therefore this column will show "x" if any value is entered into the status column. You can hide this column if you want to make things look nice and tidy.
    Then you can use =COUNTIFS(D:D,"Client 1",E:E,"x")

  14. #14
    Forum Contributor
    Join Date
    06-18-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    104

    Re: COUNTA for Indexed cells without solving for the index

    Okay I'll have to give that a whirl because that seems to be the most functional way of doing things right now. Thanks a bunch!

  15. #15
    Forum Contributor
    Join Date
    06-18-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    104

    Re: COUNTA for Indexed cells without solving for the index

    Okay I have another question for you though: this puts an X for files that do not even need a transfer (basing it off of my example spreadsheet) so that the Xs are shown for files that do not even need a transfer plus the files that are pending. Then when calculating that it shows more files than it should. So is there a way to express if B:B has text but C:C is "", then to put an x in column E? Is that possible?

  16. #16
    Forum Contributor
    Join Date
    06-18-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    104

    Re: COUNTA for Indexed cells without solving for the index

    Oh I think I figured it out, I did =IF(B:B="", "", "x") so that will show all transfers. I think that's what you said in the first place. Thanks again for all of your help today!

  17. #17
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Re: COUNTA for Indexed cells without solving for the index

    =IF(B2="","",IF(C2="","x","") should do that for you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1