+ Reply to Thread
Results 1 to 22 of 22

Count of cells referencing 2 columns but with varying numbers

  1. #1
    Registered User
    Join Date
    11-11-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    18

    Count of cells referencing 2 columns but with varying numbers

    Hi,

    I am analysing data with male and female participants. Their gender data is in B2 down, classed as F (female) or M (male). The group can have up to 40 subjects in it but is variable in nature. In W2 down is their respective performance targets. I want to count

    All females with a performance target of between -0.76 or less, 0 to -0.75 and those above 0.
    All males with a performance target of between -0.76 or less, 0 to -0.75 and those above 0.

    As the group can shrink and grow and there is data below this that could influence the accuracy of the count it needs to be dynamic in nature. There is always a space separating this and the next dataset below it.

    Any help much appreciated.

  2. #2
    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,939

    Re: Count of cells referencing 2 columns but with varying numbers

    I think it would help if you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    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

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Count of cells referencing 2 columns but with varying numbers

    You can use variants of the COUNTIFS formula, as shown in the attached file.

    If this isn't it, please attach a sample sheet, as requested above.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    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,939

    Re: Count of cells referencing 2 columns but with varying numbers

    Glenn, did you see this part?
    As the group can shrink and grow and there is data below this that could influence the accuracy of the count it needs to be dynamic in nature. There is always a space separating this and the next dataset below it.
    I almost missed it too

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Count of cells referencing 2 columns but with varying numbers

    No. Well, sort-of no. I (mis) read it as meaning that there were gaps between rows. However, now I see what the OP means... I think. it would be much clearer with a sample sheet.


    So, Bonsaitrees... Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

  6. #6
    Registered User
    Join Date
    11-11-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Count of cells referencing 2 columns but with varying numbers

    File attached.

    Expected outcome on 2nd tab. Yellow coloured columns - annotated underneath with text boxes. Hope this is OK, Glenn.
    Attached Files Attached Files

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Count of cells referencing 2 columns but with varying numbers

    I just saw your attachment. Can you confirm that this one that I'd been playing with does what you want??

    Edit: I attached the wrong file!!
    Attached Files Attached Files

  8. #8
    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,939

    Re: Count of cells referencing 2 columns but with varying numbers

    In the sample file from post 6, do you have more tables below that, with more M/F references? If not, the suggestion from Glenn should work

  9. #9
    Registered User
    Join Date
    11-11-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Count of cells referencing 2 columns but with varying numbers

    Quote Originally Posted by FDibbins View Post
    In the sample file from post 6, do you have more tables below that, with more M/F references? If not, the suggestion from Glenn should work
    No more tables below that.

    @Glenn - no worries mate. I'll watch for the correct upload.

  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,939

    Re: Count of cells referencing 2 columns but with varying numbers

    Is there anything to identify 1 table from the next? (and I dont mean empty rows)

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Count of cells referencing 2 columns but with varying numbers

    The correct sheet is there now (Post 7). Is that what you had hoped to see??

  12. #12
    Registered User
    Join Date
    11-11-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Count of cells referencing 2 columns but with varying numbers

    I'm confused by your file. In my original workbook there were 2 sheets, sheet 1 and one next to it called SL. In SL I had done a manual count of the expected outcome I had expected to see in a table format. Your sheet has one column of M and F's from B2 to B40 in column B with header in B1. No formulae are present. This is why I presumed you had uploaded the wrong file.

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Count of cells referencing 2 columns but with varying numbers

    I was working on a sheet that I mocked up myself. I had completed working on it when you posted your sheet. rather than start over and work on your sheet, I posted mine to see if it was doing what you expected, based on your description.

    So, open the file at post 7 and see if it is doing what you want. the formulae are in Z2 to AC4.

  14. #14
    Registered User
    Join Date
    11-11-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Count of cells referencing 2 columns but with varying numbers

    Ah thanks for pointing me at the formulae. In the W column in sheet 1 I can't see any value over 0 and your formula returns several. Has the minus been omitted from the formulae? The values were:

    -0.76 or less, 0 to -0.75 and those above 0.
    Last edited by bonsaitrees; 03-15-2017 at 03:58 PM.

  15. #15
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Count of cells referencing 2 columns but with varying numbers

    Rows 2, 3, 7, 10, 11, 19, 24, etc... all are greater than zero.

  16. #16
    Registered User
    Join Date
    11-11-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Count of cells referencing 2 columns but with varying numbers

    In my sample sheet row 2 is -1.97, row 3 is -0.18. Your sheet also has 40 rows of data. In mine it is row 2 to row 24. In your sheet row 2 it is 0.08 - I've done a search and the value 0.08 is not present in my sheet at all. Have you copy and pasted the right data?

  17. #17
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Count of cells referencing 2 columns but with varying numbers

    How many times... For now FORGET ABOUT YOUR SHEET.

    I have not worked on your sheet. I do not want to spend time transferring my formula to your sheet until I know that it is doing what you want.

    So look at my sheet, post 7, complete with formulae, complete with values greater than zero and tell me if it is doing what you need. Once you agree that it is what you want THEN and ONLY THEN will I set it up on your sheet (which you could have supplied right from the get-go). Had you done so, none of this to-ing and fro-ing would have been necessary.

  18. #18
    Registered User
    Join Date
    11-11-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Count of cells referencing 2 columns but with varying numbers

    Sorry mate. Yes these values are correct. Thank you for your help.

  19. #19
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Count of cells referencing 2 columns but with varying numbers

    Il5set this up on your sheet in the morning, then...

  20. #20
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Count of cells referencing 2 columns but with varying numbers

    Here you go. Check it over carefully!!
    Attached Files Attached Files

  21. #21
    Registered User
    Join Date
    11-11-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Count of cells referencing 2 columns but with varying numbers

    Thank you so much and apologies for my stupidity earlier!

  22. #22
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Count of cells referencing 2 columns but with varying numbers

    You're welcome...

+ 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. Referencing cells in varying positions
    By chilli76 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-02-2014, 03:51 PM
  2. Dividing dollar amounts unevenly into varying numbers of cells/columns
    By Busterbrown in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-26-2014, 01:26 PM
  3. [SOLVED] Merging two lists with varying numbers of columns
    By guillm in forum Excel General
    Replies: 3
    Last Post: 08-05-2013, 09:20 AM
  4. Match columns of varying numbers
    By Liam1234 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-23-2012, 10:42 AM
  5. Replies: 2
    Last Post: 12-10-2009, 01:20 PM
  6. Transpose rows to columns with varying numbers of lines per record
    By SerPetr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-04-2006, 11:40 PM
  7. Transpose rows to columns w/varying numbers of lines per record
    By MG in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-10-2005, 09:10 PM

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