+ Reply to Thread
Results 1 to 11 of 11

Issues recognizing text and counting the cell depending on a condition

  1. #1
    Registered User
    Join Date
    05-15-2014
    MS-Off Ver
    Excel 2007 for Mac
    Posts
    5

    Issues recognizing text and counting the cell depending on a condition

    Hi!

    It is my first time on this forum so I hope I don't oversee any of the rules. I am trying to do a quantitative analysis of tweets for a linguistics paper. I would like my formula to see if a condition is met and count the amount of cell where text (no specific one) is found. I would also like to count 'text' in more than one cell, and eventually be able to do a count per user.

    I have tried several things I have deleted already, not knowing quite well what certain symbols actually do, and trying to adapt some of the examples of the forum. This was my last attempt:

    =SUMPRODUCT(--('20 only'!$O$2:'20 only'!$O$1285="Chavismo"),--(ISTEXT('20 only'!$M$2:'20 only'!$M$1285),--(ISTEXT('20 only'!$N$2:'20 only'!$N$1285) )

    Attached is a simplified example of what I am looking at.

    Thank you in advance for your help!
    Attached Files Attached Files

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

    Re: Issues recognizing text and counting the cell depending on a condition

    I will take a look for you, but in the meantime...
    I notice that the file you uploaded indicates 2007 or later (.xlsx), but your profile says 2003. Please update your profile as necessary, members tailor questions based on your excel version
    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
    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,926

    Re: Issues recognizing text and counting the cell depending on a condition

    OK I presume tha your expected outcome is this?

    D
    E
    F
    G
    H
    13
    User political side
    Hashtags Urls User Mentions Media
    14
    Undefined
    0
    0
    1
    0
    15
    Opposition
    1
    0
    1
    1
    16
    Chavismo
    2
    0
    4
    3
    17
    Not Found
    0
    1
    0
    18
    TOTAL
    3
    0
    7
    4


    If so, could you walk me though how you arrive at, say, G16?

  4. #4
    Registered User
    Join Date
    05-15-2014
    MS-Off Ver
    Excel 2007 for Mac
    Posts
    5

    Re: Issues recognizing text and counting the cell depending on a condition

    Your replies were quicker than expected. Thank you!! I just did a manual count, FDibbins. I wish I were able to speak Excel better...

  5. #5
    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,926

    Re: Issues recognizing text and counting the cell depending on a condition

    OK, but a manual count of what? you have 4...what's?

  6. #6
    Registered User
    Join Date
    05-15-2014
    MS-Off Ver
    Excel 2007 for Mac
    Posts
    5

    Re: Issues recognizing text and counting the cell depending on a condition

    Oh, aha... of how many cells that have the word "Chavismo" have text on column called "User Mentions"

  7. #7
    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,926

    Re: Issues recognizing text and counting the cell depending on a condition

    OK, I still dont see it, sorry. in the range for "User Mentions" G2:G9, the string "Chavismo" does not appear anywhere. Are you sure you uploaded the correct file?

    In fact the only place on that sheet where Chavismo appears at all is in column I (User Political side) and in the small table below D16

  8. #8
    Registered User
    Join Date
    05-15-2014
    MS-Off Ver
    Excel 2007 for Mac
    Posts
    5

    Re: Issues recognizing text and counting the cell depending on a condition

    Apologies for the misunderstanding. What I want is to count, based on "User political side" options, how many cells have data per columns (E:E, F:F, G:G, H:H). Thus, I would like Excel to recognize all "Chavismo"s and count who many times Column E has text in those rows.

    My formula should have been some more like this

    =SUMPRODUCT(--($I$2:!$I$1285="Chavismo"),--(ISTEXT($I$2:$I$1285)),--(ISTEXT($E$2:$E$1285)).

    I hope this makes more sense

  9. #9
    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,926

    Re: Issues recognizing text and counting the cell depending on a condition

    Try this, copied down and across...
    =SUMPRODUCT(($I$2:$I$9=$D14)*(E$2:E$9<>""))

  10. #10
    Registered User
    Join Date
    05-15-2014
    MS-Off Ver
    Excel 2007 for Mac
    Posts
    5

    Re: Issues recognizing text and counting the cell depending on a condition

    You are a saint! It seems to be working. Thank you, thank you, thank you!!

  11. #11
    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,926

    Re: Issues recognizing text and counting the cell depending on a condition

    Happy to help and thanks for the feedback You were almost there with your formula

+ 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] Change selection depending on the condition of a cell
    By nenadmail in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-31-2012, 01:00 PM
  2. [SOLVED] Change color of text depending on condition using vba
    By jacob@thepenpoint in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-31-2012, 09:08 AM
  3. Counting cell entries depending on specific condition
    By Neales in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-24-2008, 08:01 AM
  4. [SOLVED] Recognizing #VALUE! as a condition in an IF Function Argument
    By Jim J. in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-29-2005, 06:30 PM
  5. applying function depending on condition in other cell
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-21-2005, 11:06 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