+ Reply to Thread
Results 1 to 3 of 3

Where is this 'count responses' code failing?

  1. #1
    Registered User
    Join Date
    07-24-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    73

    Where is this 'count responses' code failing?

    Hello,

    As you can see below, I have used 15 variables to store the counts for different combinations in response to the question "Have you ever been a member of the armed forces?"

    My output table is the problem because it groups responses by gender, separating men who have served in the forces, from women who have served etc.

    It outputs the final counts into a table, HOWEVER.

    Any response other than male fails to work and the output is always 0.

    Can anybody help correct the below code?



    Please Login or Register  to view this content.
    Linked Post: http://www.mrexcel.com/forum/excel-q...ml#post3814373
    Last edited by henryBukowski; 05-21-2014 at 06:19 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Where is this 'count responses' code failing?

    Is it erroring or just not doing what you want? If so can you show where the error occurs.

    Also, i've notice that you are looking for strings in title case, could it be "male" rather than "Male", i use option compare text to ignore the case, or you could say if lcase(xxxxx)="male"
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,980

    Re: Where is this 'count responses' code failing?

    It's the nesting of the If clauses. See my response in the linked thread.
    Everyone who confuses correlation and causation ends up dead.

+ 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. [SOLVED] potential indirect countif: trying to count unique values giving same responses
    By j.farr3ll in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-14-2013, 08:00 AM
  2. Replies: 3
    Last Post: 10-28-2012, 09:22 PM
  3. Replies: 3
    Last Post: 04-26-2011, 05:12 PM
  4. Code failing after x = 281
    By sach_83 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-04-2011, 04:33 PM
  5. Count responses across multiple worksheets
    By dwalzak in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-30-2010, 09:38 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