+ Reply to Thread
Results 1 to 8 of 8

Calculating average number of words in two different groups

  1. #1
    Registered User
    Join Date
    04-23-2019
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    2

    Calculating average number of words in two different groups

    Hello. I need to calculate the average number of words in the cells for two columns to see if the average number of words they entered differs between two groups.
    I believe I could just use the formula to count the number of words in each column (C and D) and divide it by the number of cells that contain words. But the problem is that the original data has over 6000 participants (i.e. 6000 rows) so it is highly likely that some participants just didn’t enter any words for some reason (see C15/D16, which are both empty). So if I were to just count the number of words in the column divided by cells with words, those participants wouldn’t be counted. There is also the matter of seemingly empty cells that might contain spaces.

    Is there a way for me to count the average number of words for each group while still counting the participants that might not have entered any words?

    I attached an example file since the original data is not to be shared, and is needlessly large for this purpose anyway, but that is approximately how the data looks. Each row in the example file represents one participant/individual, and each individual is only a part of one of two groups.

    I actually don’t know if this is even possible to do in excel, but if it is, I would be extremely grateful for any help you could offer.
    Attached Files Attached Files

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Calculating average number of words in two different groups

    would something like the below work for you?

    E1:
    =SUMPRODUCT((TRIM(C$2:C$20)<>"")+LEN(TRIM(C$2:C$20))-LEN(SUBSTITUTE(TRIM(C$2:C$20);" ";"")))/COUNTIF($A$2:$A$20;COLUMNS($E1:E1))
    copied to F1

    above would return 2.3 for Group 1 [23/10], and 2.22 for Group 2 [20/9]

    use of TRIM to remove superfluous spaces.

    note: assumed ; delimiter

  3. #3
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Calculating average number of words in two different groups

    Capture.JPG

    Few words () of comments.

    As you see {} that formula have to be accepted with Ctrl+Shift+Enter.

    to count non empty cells you can use:

    Please Login or Register  to view this content.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  4. #4
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Calculating average number of words in two different groups

    Quote Originally Posted by XLent View Post
    would something like the below work for you?
    above would return 2.3 for Group 1 [23/10], and 2.22 for Group 2 [20/9]
    Why 10 and 9 ? if both (C&D) contains 8 non empty cells?

  5. #5
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Calculating average number of words in two different groups

    per OP......

    Is there a way for me to count the average number of words for each group while still counting the participants that might not have entered any words?

  6. #6
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Calculating average number of words in two different groups

    As i am assuming
    In "e1"
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Above formula copied to F1


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  7. #7
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Calculating average number of words in two different groups

    Quote Originally Posted by XLent View Post
    per OP......
    I am confused because:
    "count the number of words in each column (C and D) and divide it by the number of cells that contain words"
    but I am not original English so maybe from full context I missed something.

  8. #8
    Registered User
    Join Date
    04-23-2019
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    2

    Re: Calculating average number of words in two different groups

    Quote Originally Posted by XLent View Post
    would something like the below work for you?

    E1:
    =SUMPRODUCT((TRIM(C$2:C$20)<>"")+LEN(TRIM(C$2:C$20))-LEN(SUBSTITUTE(TRIM(C$2:C$20);" ";"")))/COUNTIF($A$2:$A$20;COLUMNS($E1:E1))
    copied to F1

    above would return 2.3 for Group 1 [23/10], and 2.22 for Group 2 [20/9]

    use of TRIM to remove superfluous spaces.

    note: assumed ; delimiter
    This seems to be it! Thank you so much!
    I had encountered similar formulas while googling my problem but I think most of them were missing the "/COUNTIF"-part. It's very hard to find the exact formula you need just by googling. Or maybe I'm just awful at googling.

+ 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] Calculating the number of matching words between two text cells
    By oppunzano in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-11-2017, 03:25 AM
  2. Calculating a fractional average (salary) for a changing base number (bonus program start
    By Bastiaan van Vliet in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-26-2017, 05:47 PM
  3. Replies: 2
    Last Post: 02-09-2014, 12:40 AM
  4. Calculating the Average for Every Other Number while Ignoring #N\A
    By leongandrew in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 05-09-2013, 10:05 PM
  5. calculating average against a group and week number
    By HiltonC in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-09-2013, 08:58 PM
  6. Quick way to group 50,000 words in groups of 1,000?
    By starplayx in forum Excel General
    Replies: 2
    Last Post: 10-16-2009, 06:52 AM
  7. [SOLVED] how do I find an average number of specific words in a column
    By cashgrfx in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 01-06-2005, 01:06 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