+ Reply to Thread
Results 1 to 12 of 12

Partial text frequency counting in reports

  1. #1
    Registered User
    Join Date
    10-05-2021
    Location
    Netherlands
    MS-Off Ver
    2016
    Posts
    10

    Question Partial text frequency counting in reports

    Hi there,

    I am trying to extract thefrequency of a certain abnormality (adenoma) out of multiple reports. The problem is that due to the pharsing in the reports ( ex. no adenoma found) I get false hits if I just look for the word adenoma in the cell. Is there a way to efficiently discern between these two? The database consist of 10k+ reports so I am unable to check them all manually.

    I tried to use this formula someone on this forum was kind enough to send me, to find the frequency of mentions of no adenoma for example: =SUMPRODUCT(ISNUMBER(SEARCH("no* adenoma";TRIM(MID(SUBSTITUTE($B4;":";REPT(" ";LEN($B4)));(ROW($B$1:$B$10)-1)*LEN($B4);LEN($B4)))))+0)
    This formula seems to work for simple one line answers in the sample worksheet at the time, but once I checked a sample of the complex reports it doesn't work anymore.

    In the worksheet you will find fictive examples of reports in terms of pharsing.

    Thanks for the help!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Partial text frequency counting in reports

    It is not surprising the original formula does not work as the "new" data is in a completely different format (free format vs structured) to that in your original post.


    See attached where the original formula works (Yellow highlight) as the colon ":") is used to delimit (divide) the text into discrete "sets" of data.

    In the non-highlighted rows the delimiter is a full stop and this gives the correct results.

    NOTE: as per the original, the calculation of "adenomas" is a subtraction of column D from column C.

    VBA solution might be a (better) option.
    Attached Files Attached Files
    Last edited by JohnTopley; 10-21-2021 at 05:53 AM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Forum Expert
    Join Date
    01-25-2011
    Location
    Belgium, Alveringem
    MS-Off Ver
    Excel 2003, 2007, 365
    Posts
    1,418

    Re: Partial text frequency counting in reports

    a VBA-solution
    Attached Files Attached Files
    Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

  4. #4
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    Germany
    MS-Off Ver
    365
    Posts
    491

    Re: Partial text frequency counting in reports

    First, the references in your columnd D are off/wrong.

    Also, substitute is case sensitive, isn't it? Maybe that's why it's not working anymore?

  5. #5
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    Germany
    MS-Off Ver
    365
    Posts
    491

    Re: Partial text frequency counting in reports

    Lazy man's solution attached. Does that work?

    I guess I won't sleep well tonight after reading so much about polyps and biopsy from anus
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    Germany
    MS-Off Ver
    365
    Posts
    491

    Re: Partial text frequency counting in reports

    Attached slightly improved.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-05-2021
    Location
    Netherlands
    MS-Off Ver
    2016
    Posts
    10

    Re: Partial text frequency counting in reports

    Quote Originally Posted by JohnTopley View Post
    It is not surprising the original formula does not work as the "new" data is in a completely different format (free format vs structured) to that in your original post.


    See attached where the original formula works (Yellow highlight) as the colon ":") is used to delimit (divide) the text into discrete "sets" of data.

    In the non-highlighted rows the delimiter is a full stop and this gives the correct results.

    NOTE: as per the original, the calculation of "adenomas" is a subtraction of column D from column C.

    VBA solution might be a (better) option.
    A I see I'm still pretty new to excel and didnt catch on to that thanks for the tip!

  8. #8
    Registered User
    Join Date
    10-05-2021
    Location
    Netherlands
    MS-Off Ver
    2016
    Posts
    10

    Re: Partial text frequency counting in reports

    Quote Originally Posted by bsalv View Post
    a VBA-solution
    Thank you this seems to work perfectly! I've never heard of VBA before, but if I learn a few things I think I could use this to attain my goal in the actual database as well as some others!

  9. #9
    Registered User
    Join Date
    10-05-2021
    Location
    Netherlands
    MS-Off Ver
    2016
    Posts
    10

    Re: Partial text frequency counting in reports

    Quote Originally Posted by RaulSerg View Post
    Lazy man's solution attached. Does that work?

    I guess I won't sleep well tonight after reading so much about polyps and biopsy from anus
    I guess I forgot to save because I did fix that before hand whoops. Thanks for your effort, I hope you can still sleep soundly tonight :P

  10. #10
    Registered User
    Join Date
    10-05-2021
    Location
    Netherlands
    MS-Off Ver
    2016
    Posts
    10

    Re: Partial text frequency counting in reports

    I think I can achieve what I want to achieve if I learn some VBA skills and build further upon bsalv's work, so solved for now

  11. #11
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    Germany
    MS-Off Ver
    365
    Posts
    491

    Re: Partial text frequency counting in reports

    //edit//..

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Partial text frequency counting in reports

    Administrative Note:

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. As you are still quite new here, I will do it for you this time: https://www.mrexcel.com/board/thread...nting.1185314/.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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. Discerning between partial text and frequency counting
    By losc in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-05-2021, 07:28 AM
  2. Replies: 3
    Last Post: 04-17-2020, 03:43 PM
  3. [SOLVED] Frequency & Counting instances of specific text
    By moneypennie21 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-24-2020, 10:03 AM
  4. [SOLVED] Please help on COUNTIF Partial text, partial text/words also contained in other texts
    By maria.h in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-15-2020, 10:18 PM
  5. Counting Cells if a value contains a partial test of text
    By Robbie8 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-15-2016, 05:40 PM
  6. [SOLVED] Partial Text Counting and calculating
    By Groovicles in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-31-2013, 10:17 AM
  7. [SOLVED] Counting frequency of Large Spreadsheets of text
    By wholemilk in forum Excel General
    Replies: 4
    Last Post: 07-22-2012, 11:29 AM

Tags for this Thread

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