+ Reply to Thread
Results 1 to 47 of 47

How to count only cells with names (and not numbers), and other questions.

  1. #1
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    How to count only cells with names (and not numbers), and other questions.

    Hello,

    I'm a very big noob at excel and am trying to learn the basics. I'm trying to use advanced filters to count each occurrence of a given name on a new sheet.

    I'm encountering 2 problems:

    The first problem I have is that sometimes there are dates in the same column as the names, and I don't want to count these dates. There are also blank cells which I do not want to count.
    I'm inspired by the following tutorial:
    https://www.youtube.com/watch?v=bGUKjXmEi2E
    I'd like to filter out the numbers and blank cells so that only the names appear on my new worksheet.
    What would be a good formula to only count the names and not the numbers and blank cells?

    The second problem I'm encountering is that I only want the names to be counted when a value in the cell to the right is 1 or more. If the cell to the right of the name has a value of 0, the name shouldn't be counted. Again, what would be the best formula for this?

    I hope this is clear enough

    Thanks in advance for your help.
    Last edited by SperryACHI; 06-28-2015 at 04:02 PM. Reason: edited title

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,459

    Re: How to use advanced filters to count only cells with names (and not numbers).

    .......................................................
    Last edited by Pepe Le Mokko; 06-27-2015 at 12:50 PM.

  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: How to use advanced filters to count only cells with names (and not numbers).

    Not real clear what you want to do.

    You mention the count of names but then you also ask that these names appear on another sheet.

    How about posting a SMALL sample file and showing us what result you expect?

    A SMALL file will have about 20 rows worth of data. We don't need files with 100's or 1000's of rows and dozens of columns worth of data. This just makes it harder to figure out what you want.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to use advanced filters to count only cells with names (and not numbers).

    Ok here you go.
    I apparently still have some ways to go to master the jargon.
    I'll try to describe as best I can the effect I'm looking for.

    Copy of sample file2.xls

    I need to count all the names on sheet 1. The total must appear on sheet 2. The dates, as well as the blank spaces are not to be counted and should not figure on sheet 2.

    However, the names only are to be counted on sheet 2 when Condition 1 is met.

    Also, on sheet 2 the different variables under "data 2" must be included and added accordingly.

    That's about it. Please tell me if you need more clarifications. I'm very new to this.

    Thanks
    Last edited by SperryACHI; 06-28-2015 at 09:22 AM. Reason: Following Tony Valko's suggestion, I've updated the sample file here too.

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

    Re: How to use advanced filters to count only cells with names (and not numbers).

    How about updating the sample with the results you expect?

    On a side note... Why is everything so big? Makes it harder to view the data structure.

  6. #6
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to use advanced filters to count only cells with names (and not numbers).

    Here's an updated sample file with the results on the second sheet. Please note that some of the data has been modified since the last uploaded file.

    Is everything so big? I can't tell, that's just how it appears on my computer. Feel free to modify font size and any other parameters.

    Copy of sample file2.xls

    Thanks again and please don't hesitate to ask for details if anything appears unclear.
    Last edited by SperryACHI; 06-27-2015 at 03:30 PM.

  7. #7
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to use advanced filters to count only cells with names (and not numbers).

    Any luck? Is the sample file clear enough?

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

    Re: How to use advanced filters to count only cells with names (and not numbers).

    I think this is what you want...

    Data Range
    B
    C
    D
    E
    F
    G
    H
    1
    Data 2
    2
    Name
    Variable 9
    Variable 10
    Variable 11
    Variable 12
    Variable 13
    Variable 14
    3
    Milly
    0
    2
    1
    0
    0
    0
    4
    Louisa
    0
    0
    0
    1
    1
    0
    5
    Fred
    0
    0
    0
    0
    0
    1
    6
    Sylvester
    1
    0
    0
    0
    0
    1
    7
    Carl
    0
    0
    0
    1
    0
    0
    8
    9
    ------
    ------
    ------
    ------
    ------
    ------
    ------


    Enter this array formula** in B3:

    =IF(ISERROR(INDEX(Sheet1!C$6:C$16,MATCH(0,IF(Sheet1!C$6:C$16<>"",IF(Sheet1!O$6:O$16=1,COUNTIF(B$2:B2,Sheet1!C$6:C$16))),0))),"",INDEX(Sheet1!C$6:C$16,MATCH(0,IF(Sheet1!C$6:C$16<>"",IF(Sheet1!O$6:O$16=1,COUNTIF(B$2:B2,Sheet1!C$6:C$16))),0)))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down until you get blanks.

    Enter this formula in C3:

    =IF(B3<>"",SUMIF(Sheet1!$C$6:$C$16,$B3,INDEX(Sheet1!$P$6:$U$16,0,MATCH(C$2,Sheet1!$P$5:$U$5,0))),"")

    Copy across to H3 then down as needed.

    If you don't want to see the 0 values we can use conditional formatting to hide them.

  9. #9
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to use advanced filters to count only cells with names (and not numbers).

    Whoa! That looks like two very complex formulas.
    Thanks so much.
    However, I must be doing something wrong, because I keep getting "The formula contains an error" message when I try to copy+paste any of these formulas into sheet2 or sheet2 (2).

    In the case of the array formula, when pressing CTRL+SHIFT+ENTER, sometimes the formula simply appears as is within the cell (in B3), and sometimes the same error message appears. Also, "C$16,MATCH" is highlighted in the formula bar.

    As for the second formula (the one in C3), it doesn't appear to work either as I get the same message. What am I doing wrong?

    BTW I'm using the sample file included above to test the formulas.
    Last edited by SperryACHI; 06-28-2015 at 04:36 PM.

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: How to count only cells with names (and not numbers), and other questions.

    Tony's 1st formula is the basis for the others. It is an ARRAY formula, and needs to be entered using CTRL SHIFT ENTER, not just enter.
    After entering the 1st 1 like that, you can copy it down further. the otrher formula is a regular formula, entered the normal way
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  11. #11
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to count only cells with names (and not numbers), and other questions.

    Quote Originally Posted by FDibbins View Post
    Tony's 1st formula is the basis for the others. It is an ARRAY formula, and needs to be entered using CTRL SHIFT ENTER, not just enter.
    After entering the 1st 1 like that, you can copy it down further. the otrher formula is a regular formula, entered the normal way

    So far, this is what I do:

    1. highlight the B3 cell.
    2. click on the formula bar
    3. copy and paste the array formula into the formula bar
    4. press CTRL SHIFT and ENTER

    I've also tried this:

    1. highlight the B3 cell.
    2. copy and paste the array formula directly into the cell
    3. press CTRL SHIFT and ENTER

    Despite these attempts, the error persists. I'm probably doing something wrong, but I can't tell what.
    Last edited by SperryACHI; 06-28-2015 at 04:59 PM.

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: How to count only cells with names (and not numbers), and other questions.

    If you already have the formula in the cell, press F2 (edit), then press CTRL SHIFT ENTER. Dont just press CSE while just "on" the cell, you need to edit the cell.
    If you do not have anything in B3, then copy/paste the formula to the formula bar, THEN press CSE

    You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    Attached is your sample, with Tony's formula
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to count only cells with names (and not numbers), and other questions.

    Quote Originally Posted by FDibbins View Post
    You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    Ok, thanks for the file.

    So now I tried this:

    1. highlight the B3 cell.
    2. click on the formula bar
    3. press F2
    4. copy and paste the array formula into the formula bar
    5. press CTRL SHIFT and ENTER

    And this:

    1. highlight the B3 cell.
    2. press F2
    3. copy and paste the array formula directly into the cell
    4. press CTRL SHIFT and ENTER

    I see the curly braces { } in your attached file, but when I press F2 on my initial sheet, nothing appears to happen (that is, the curly braces { } do not appear in the cell nor in the formula bar).

    Also, I've tried pressing F2 before and after I copy and paste the formula, but still nothing happens.

    I'm following your indications as close as I can. You all explain very clearly, and I don't understand why it doesn't work... Those { } curly braces just don't want to appear...

    I've even tried using both left and right Ctrl+Shift keys. Is there any way around this? Excel 2003 does use array formulas, right?
    Last edited by SperryACHI; 06-28-2015 at 05:46 PM.

  14. #14
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: How to count only cells with names (and not numbers), and other questions.

    Yes, excel does use ARRAY's

    Dont press F2 after you enter using CSE.

    Lets assume you already have a copy of the formula in the cell...

    1. make sure teh cursor is on the cell (click ONCE on the cell, if it not)
    2. Press F2
    3. press and hold CTRL (dont let go yet)
    4. Press and hold SHIFT (dont let go yet)
    5. Press ENTER (you can now let go of the other 2 keys)
    You should now see the {}

    That is all you need to do - do NOT press F2 or edit the cell after (5). If you do need to, then follow steps 1-5 again
    Last edited by FDibbins; 06-28-2015 at 05:44 PM.

  15. #15
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to count only cells with names (and not numbers), and other questions.

    Quote Originally Posted by FDibbins View Post
    Lets assume you already have a copy of the formula in the cell...

    1. make sure teh cursor is on the cell (click ONCE on the cell, if it not)
    2. Press F2
    3. press and hold CTRL (dont let go yet)
    4. Press and hold SHIFT (dont let go yet)
    5. Press ENTER (you can now let go of the other 2 keys)
    You should now see the {}
    This is what I've been doing, but the {} don't appear and I get the aforementioned error message as soon as I press enter.

    I've searched google for problems concerning CSE, but still no luck.
    Last edited by SperryACHI; 06-28-2015 at 05:54 PM.

  16. #16
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: How to count only cells with names (and not numbers), and other questions.

    Can you upload what you have?

  17. #17
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to count only cells with names (and not numbers), and other questions.

    Of course.

    Sample file 3 contains as much as I'm able to do despite errors. It's essentially identical to the last sample file I've uploaded (sample file 2).

    Copy of sample file3.xls

    Copy of sample file2.xls

    You'll notice the absence of { } in both files...
    Last edited by SperryACHI; 06-28-2015 at 06:17 PM.

  18. #18
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: How to count only cells with names (and not numbers), and other questions.

    I opened file3.xls, pressed F2 held down CTRL and SHIFT and pressed ENTER, and it worked

    In C3, not sure why is is showing like that, I pressed F2, then enter

  19. #19
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to count only cells with names (and not numbers), and other questions.

    I also get the same error message for C3

    I'll try on a different computer and let you know.

  20. #20
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to count only cells with names (and not numbers), and other questions.

    Nope. I'm on a computer at work. It's got a fresh new version of excel, so everything should work.

    However, when I open the file, press F2, hold down CTRL+SHIFT and then (without letting go) press ENTER, I get the same error message.

    Would the fact that I'm in France (keyboard setup) have any impact on array formulas? Is there any way around shortcut keys for array formulas?

    I still don't see what I'm doing wrong, even though it seems so simple according to your indications.

    I'm stumped

  21. #21
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to count only cells with names (and not numbers), and other questions.

    I was able to CTRL+SHIFT+ENTER using the example on the following page:

    https://support.office.com/en-au/art...6e9ecee523#bm1

    The array formula worked! And I got the { }! So now I know that it is indeed possible!

    However, when I try to copy and paste Tony Valco's code, I keep getting the error message.
    Here's his code once again:

    =IF(ISERROR(INDEX(Sheet1!C$6:C$16,MATCH(0,IF(Sheet1!C$6:C$16<>"",IF(Sheet1!O$6:O$16=1,COUNTIF(B$2:B2,Sheet1!C$6:C$16))),0))),"",INDEX(Sheet1!C$6:C$16,MATCH(0,IF(Sheet1!C$6:C$16<>"",IF(Sheet1!O$6:O$16=1,COUNTIF(B$2:B2,Sheet1!C$6:C$16))),0)))

    The frustrating thing about this error message is that I still have no indication as to what I'm doing wrong. Can anyone help?

    edit: I just found this site with translations of english formulas into french ones. I had no clue Excel functions are language specific! Could this explain the error messages? I'll be trying it out tonight, fingers crossed.
    Last edited by SperryACHI; 06-29-2015 at 04:21 PM.

  22. #22
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to count only cells with names (and not numbers), and other questions.

    Sadly, entering the formulas in another language does not work either.

    Sorry for insisting, but its very frustrating to see that despite following your simple instructions, the formula doesn't appear to work. Can any of you people please help me find a way around this?

    I trust you believe me when I say I get an error despite effectively pressing CTRL+SHIFT+ENTER (the short-cut isn't exactly complicated).

    Is there any way around short-cut keys?

    If not, is there any way to troubleshoot array formulas to see when things go wrong?

    Perhaps it's a problem with the formula? Could it be that it isn't compatible on my version of excel?

    The segment "C$16,MATCH" of the formula is highlighted after the error appears.
    Last edited by SperryACHI; 06-29-2015 at 04:23 PM.

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

    Re: How to count only cells with names (and not numbers), and other questions.

    In some international locations they use the semi-colon as the default delimiter. In the U.S. we use the comma. For example...

    U.S. =SUM(A1,D2)

    Some other location would use =SUM(A1;D2)

  24. #24
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to count only cells with names (and not numbers), and other questions.

    Quote Originally Posted by Tony Valko View Post
    In some international locations they use the semi-colon as the default delimiter. In the U.S. we use the comma. For example...

    U.S. =SUM(A1,D2)

    Some other location would use =SUM(A1;D2)
    Yes!! You are the greatest! I've replaced all the comas with semi-colons and the formulas work now! Thank you so much!

    Topic solved!

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

    Re: How to count only cells with names (and not numbers), and other questions.

    You're welcome. Thanks for the feedback!


    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

  26. #26
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to count only cells with names (and not numbers), and other questions.

    I was just about to mark the question as solved when I encountered another problem. Hopefully it's going to be the final one (and easy one).

    I'm now able to use array formulas in the sample document I uploaded.

    However, my initial document is huge, and has about 10 sheets full of names and data.

    When I copy and paste the array formula into my initial document, I don't get an error message. But, instead, I only get a blank cell...

    The cell layout is identical to the one in the sample document. I actually used my initial document as a template for the sample I've uploaded.

    Why would I get blank cells when copying the formula into my initial document, if I was able to make it work in the sample document?

    The array formula should go into B3...
    The other formula should go into C3...

    Thanks for helping me figure out this final bit, and sorry for the hassle!
    Last edited by SperryACHI; 06-29-2015 at 05:21 PM.

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

    Re: How to count only cells with names (and not numbers), and other questions.

    Would have to see the file.

    If it's a huge file then I have to pass as I have file size limits!

  28. #28
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to count only cells with names (and not numbers), and other questions.

    I've once again taken my initial document, and modified it. For simplicity sake, there's only one data sheet. The elements of 'Janvier 2015' must be copied into 'RESULTATS'. I've taken the care of removing all names for confidentiality.

    I've tried applying the formula above, now that I kind of understand how array formulas work. However when I do so I only get blank cells. As far as I can see, the setup is identical to the sample document, only there are many more rows.

    I'm assuming once this gets working I'll be able to fill the blanks and simply insert the extra pages... right?

    Attachment 404312
    Last edited by SperryACHI; 06-29-2015 at 05:44 PM.

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

    Re: How to count only cells with names (and not numbers), and other questions.

    The file is too big for me.

  30. #30
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to count only cells with names (and not numbers), and other questions.

    Ok nevermind, I'll figure it out. I think if I extend the range of the columns, it should work fine. I'll mark this topic as solved...
    Last edited by SperryACHI; 06-29-2015 at 08:13 PM.

  31. #31
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to count only cells with names (and not numbers), and other questions.

    I'm really sorry about this, but I've still got a few questions. The amount of time this is taking is in part my own fault. Many thanks for your patience.

    Now that the array formula question is solved, I'm happy to say that this first element of my sheet works flawlessly. I am amazed at excel's power. The second one, on the other hand, perhaps still needs fine tuning. Once again, my fault: I was not clear enough the first time around about the results I need. I have two small questions, all regarding the second formula:

    =IF(B3<>"",SUMIF(Sheet1!$C$6:$C$16,$B3,INDEX(Sheet1!$P$6:$U$16,0,MATCH(C$2,Sheet1!$P$5:$U$5,0))),"")

    For easy reference, here's a link to the post where this formula is first proposed.

    1. The data from a given row in columns P to U (variables 9 to 14) is to be counted only if there is a 1 in the corresponding row of column O (condition 1). I've added yet another sample file to illustrate what I mean. You'll now see a slight difference between your data and the results the results I expect. I hope it's clear enough. Once again: the 'variables' should only be counted when 'condition 1' is met.

    Copy of sample file 2nd formula.xls

    2. Despite the formula working flawlessly in the sample file, I sometimes get #N/A in the cells when I try to copy the cell. This happens exclusively when I try to copy the cell to the right. This is no doubt another noob mistake, but I've been playing around with the $ signs since last night without any luck. What could be the cause of this? What could I be missing?

    Any help is once again greatly appreciated.
    Last edited by SperryACHI; 06-30-2015 at 04:00 AM.

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

    Re: How to count only cells with names (and not numbers), and other questions.

    For question 1...

    This formula entered in C3 on Sheet2:

    =SUMPRODUCT(--(Sheet1!$C$6:$C$18=$B3),--(Sheet1!$O$6:$O$18=1),INDEX(Sheet1!$P$6:$U$18,0,MATCH(C$2,Sheet1!$P$5:$U$5,0)))

    Copy across to H3 then down as needed.

    Question 2...

  33. #33
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to count only cells with names (and not numbers), and other questions.

    Thanks once again for the formula.

    I've solved the second question. Once again, the error was simply because of sloppy planning.

    I have just one last question please (I really mean it).

    What would be the best way to add up (in a new column) each time a given name (ex:B3-B7) coincides with 'condition 1' of sheet1 (O3-07)?

    For example, on sheet1, Milly and 'Condition 1' coincide twice. Louisa, Fred, Sylvester and Carl each have one single 'Condition 1' marked. All other names from sheet1 do not figure on this list...

    Here are the expected results (some data from sheet1 of the sample document is required):

    Variable 9 Variable 10 Variable 11 Variable 12 Variable 13 Variable 14 TOTAL
    Milly 2 1 2
    Louisa 1 1 1
    Fred 1 1
    Sylvester 1 1 1
    Carl 1 1
    Last edited by SperryACHI; 06-30-2015 at 06:45 PM.

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

    Re: How to count only cells with names (and not numbers), and other questions.

    If I understand, I think this will do that:

    =SUMPRODUCT(--(Sheet1!$C$6:$C$18=$B3),--(Sheet1!$O$6:$O$18=1))

  35. #35
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to count only cells with names (and not numbers), and other questions.

    Yes perfect! Thank you so much. Your patience and open mildness are very admirable. Also, those formulas, especially the first one, are very impressive. Hats off. The topic is now solved.

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

    Re: How to count only cells with names (and not numbers), and other questions.

    You're welcome. Thanks for the feedback!

  37. #37
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to count only cells with names (and not numbers), and other questions.

    I'm very sorry about this, but I'm still encountering a few problems, despite all of the time invested in my project.

    Should I keep posting here, or start a new topic?

    Here's my question, which always concerns the document we've been talking about in this thread up to now:

    I've got several sheets with names, which all have a layout identical to sheet1.

    I thought that by replacing sheet1 with the name of the other sheets (ex: sheet14), I would be able to handle the data the same way. Alas, when I try to replace sheet1 by sheet14 on my 'results' sheet, I only get a blank cell instead of names. This happens even though the layout of sheet14 is identical to sheet1. Is there anything I'm forgeting? What could I be doing wrong here?
    Last edited by SperryACHI; 07-07-2015 at 01:39 PM.

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

    Re: How to count only cells with names (and not numbers), and other questions.

    Post an updated sample file with a couple of sheets (we don't need a file with 10's of sheets!).

    Remember, it's a SAMPLE file and should only include enough data to demonstrate your problem. All other unrelated/irrelevant data just makes it harder to analyze your data and solve the problem.

  39. #39
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to count only cells with names (and not numbers), and other questions.

    Ok, I figured out what was wrong. I wasn't the author of the table, so some of the data is difficult for me to grasp. There were a few useless extra columns added here and there which completely threw off my formulas. But when I finally figured this out, I was able to easily fix the problem.

    However I have just one last question. Would it be possible to make a grand total of the names associated to my "condition 1" column throughout all sheets? For example, let's say the name Sylvester is on two sheets, and is twice associated with "condition 1"; I'd like both of these occurrences to figure on a grand total sheet.

    Here's a sample file. Sheet1a and Sheet1b have data, and Sheet2 presents the expected results.

    Sample File 4.xls

    Also, how the heck did you learn all of this?

    And thanks.

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

    Re: How to count only cells with names (and not numbers), and other questions.

    The resulting formulas will be extremely complex. Orders of magnitude more complex than the formulas that have already been suggested in this thread.

    I would suggest a summary table on each sheet in the exact same format in the exact same location then you could get a grand summary from those tables much more easily.

  41. #41
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to count only cells with names (and not numbers), and other questions.

    I think I understand. But this might be difficult because I'm not the author of the initial sheets and am not necessarily authorised to modify them (or more precisely, I'd rather be able to simply build on the existing sheets without too many excess sheets). Also, please consider that I eventually did succeed in using the formulas. If such formulas are possible, I am very motivated in attempting to use them.

    If they really are too complicated, I'll of course try the summary table suggestion, even if it means using extra sheets to combine the data.
    Last edited by SperryACHI; 07-08-2015 at 06:21 PM.

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

    Re: How to count only cells with names (and not numbers), and other questions.

    Ok, I'll update the sample file.

    Does this have to work in Excel 2003 or can it be designed to work in later versions?

  43. #43
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to count only cells with names (and not numbers), and other questions.

    I'm afraid it has to work in excel 2003.

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

    Re: How to count only cells with names (and not numbers), and other questions.

    You'll have to enter the sheet names in a HORIZONTAL range of cells. In the sample file I've used the range K3:L3 and given those cells the defined named range of Sheets.

    If your real sheet names follow some sequential naming pattern then we can place the sheet names directly into the formula (which will make the formulas even more complex and long!).

    Each sheet included in the summary MUST have the EXACT same layout.

    Enter these formulas on Sheet2 in the respective cells:

    C3:

    =SUMPRODUCT(--(T(OFFSET(INDIRECT("'"&Sheets&"'!C6:C16"),ROW(INDIRECT("C6:C16"))-6,,))=B3),--(N(OFFSET(INDIRECT("'"&Sheets&"'!O6:O16"),ROW(INDIRECT("O6:O16"))-6,,))=1),--(N(OFFSET(INDIRECT("'"&Sheets&"'!P6:P16"),ROW(INDIRECT("P6:P16"))-6,,))=1))

    D3:

    =SUMPRODUCT(--(T(OFFSET(INDIRECT("'"&Sheets&"'!C6:C16"),ROW(INDIRECT("C6:C16"))-6,,))=B3),--(N(OFFSET(INDIRECT("'"&Sheets&"'!O6:O16"),ROW(INDIRECT("O6:O16"))-6,,))=1),--(N(OFFSET(INDIRECT("'"&Sheets&"'!Q6:Q16"),ROW(INDIRECT("Q6:Q16"))-6,,))=1))

    E3:

    =SUMPRODUCT(--(T(OFFSET(INDIRECT("'"&Sheets&"'!C6:C16"),ROW(INDIRECT("C6:C16"))-6,,))=B3),--(N(OFFSET(INDIRECT("'"&Sheets&"'!O6:O16"),ROW(INDIRECT("O6:O16"))-6,,))=1),--(N(OFFSET(INDIRECT("'"&Sheets&"'!R6:R16"),ROW(INDIRECT("R6:R16"))-6,,))=1))

    F3:

    =SUMPRODUCT(--(T(OFFSET(INDIRECT("'"&Sheets&"'!C6:C16"),ROW(INDIRECT("C6:C16"))-6,,))=B3),--(N(OFFSET(INDIRECT("'"&Sheets&"'!O6:O16"),ROW(INDIRECT("O6:O16"))-6,,))=1),--(N(OFFSET(INDIRECT("'"&Sheets&"'!S6:S16"),ROW(INDIRECT("S6:S16"))-6,,))=1))

    G3:

    =SUMPRODUCT(--(T(OFFSET(INDIRECT("'"&Sheets&"'!C6:C16"),ROW(INDIRECT("C6:C16"))-6,,))=B3),--(N(OFFSET(INDIRECT("'"&Sheets&"'!O6:O16"),ROW(INDIRECT("O6:O16"))-6,,))=1),--(N(OFFSET(INDIRECT("'"&Sheets&"'!T6:T16"),ROW(INDIRECT("T6:T16"))-6,,))=1))

    H3:

    =SUMPRODUCT(--(T(OFFSET(INDIRECT("'"&Sheets&"'!C6:C16"),ROW(INDIRECT("C6:C16"))-6,,))=B3),--(N(OFFSET(INDIRECT("'"&Sheets&"'!O6:O16"),ROW(INDIRECT("O6:O16"))-6,,))=1),--(N(OFFSET(INDIRECT("'"&Sheets&"'!U6:U16"),ROW(INDIRECT("U6:U16"))-6,,))=1))

    Select the range C3:H3 and copy down as needed.

    I have disabled the display of 0 values (Tools>Options>View>Zero values)

    Here's your file with these formulas implemented.
    Attached Files Attached Files

  45. #45
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to count only cells with names (and not numbers), and other questions.

    Ok, I'm looking into it now.

    The sheet names are the months:

    January, February, April, March...

    Each sheet has the same layout, but some have more entries than others.
    Last edited by SperryACHI; 07-11-2015 at 09:00 AM.

  46. #46
    Registered User
    Join Date
    06-27-2015
    Location
    France
    MS-Off Ver
    Office 2003
    Posts
    26

    Re: How to count only cells with names (and not numbers), and other questions.

    The formula is good, but I have just one more request. Would it be possible to formulas for the names too? That is, for column B? Each name should appear only once.

    Regarding the layout, I'd just like to add that every sheet does not necessarily have the same names, in the same order.
    Last edited by SperryACHI; 07-11-2015 at 09:01 AM.

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

    Re: How to count only cells with names (and not numbers), and other questions.

    Quote Originally Posted by SperryACHI View Post
    Would it be possible to formulas for the names too? That is, for column B? Each name should appear only once.
    I don't know if that's possible with formulas.

    Let me see if I can come up something but don't hold your breath!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Count number of rows selected when using advanced filters
    By DanaHoff in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 04-14-2014, 02:13 PM
  2. Replies: 1
    Last Post: 08-05-2013, 01:55 AM
  3. Replies: 1
    Last Post: 10-15-2010, 09:36 AM
  4. Advanced filters
    By kaffal in forum Excel General
    Replies: 3
    Last Post: 01-23-2009, 10:31 PM
  5. [SOLVED] Advanced Filters
    By Louise in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-26-2005, 07:05 AM

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