+ Reply to Thread
Results 1 to 6 of 6

Tweak formula to be non- case sensitive and also counts only exact words

  1. #1
    Registered User
    Join Date
    10-14-2019
    Location
    Honolulu, Hawaii
    MS-Off Ver
    Office Professional Plus 2016
    Posts
    3

    Tweak formula to be non- case sensitive and also counts only exact words

    My data set is a bunch of Tweets and I want to use a pre determined lexicon to count how many times certain words appear in the data set. My lexicon has a category, word in Tweet to search for, and weight of the word. Right now I am trying to find out how many times a certain word appears in the data set and then repeat that calculation again for each of the 30k words.

    I figured out how to count the words but it is counting everything that is like the word and also is case sensitive. For example, it counts 'determined' when the word is 'determine' but doesn't count 'Determined'

    This is the formula I am using where my data are on sheet1c54:c1783. The word to be found is in cell B54. This cell changes because there are thousands of words to find and I don't want to write in the actual words in the formula, just where they are located so I can drag down the column.

    "SUMPRODUCT((LEN(Sheet1!C54:C1783)-LEN(SUBSTITUTE(Sheet1!C54:C1783,B54,"""")))/LEN(B54))"

    Can you help me adjust this formula so that in a sentence like "I need to determine what my GPA is after this test." or "Determine what your GPA is." it counts 1 for each sentence but in a sentence like "I am determined to find my GPA" it counts 0.

    Thank you in advance!

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

    Re: Tweak formula to be non- case sensitive and also counts only exact words

    Try this:

    =SUMPRODUCT((LEN(Sheet1!C54:C56)-LEN(SUBSTITUTE(UPPER(Sheet1!C54:C56),UPPER(B54),"")))/LEN(B54))
    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

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

    Re: Tweak formula to be non- case sensitive and also counts only exact words

    Haha. i got confused by your requirement.

    Try this:

    =SUMPRODUCT((LEN(" "&Sheet1!C54:C56&" ")-LEN(SUBSTITUTE(UPPER(" "&Sheet1!C54:C56&" "),UPPER(" "&B54&" "),"")))/LEN(" "&B54&" "))
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Tweak formula to be non- case sensitive and also counts only exact words

    Please try.

    Please Login or Register  to view this content.
    Regards.
    Last edited by menem; 10-20-2019 at 05:35 AM. Reason: Add code tags

  5. #5
    Registered User
    Join Date
    10-14-2019
    Location
    Honolulu, Hawaii
    MS-Off Ver
    Office Professional Plus 2016
    Posts
    3

    Re: Tweak formula to be non- case sensitive and also counts only exact words

    Glenn! You are a genius and a complete lifesaver!!! With a little tweak, your formula worked!!! Thank you SO VERY much! This is the final formula that I am using:

    =SUMPRODUCT((LEN(" "&editeddata!$C$2:$C$1731&" ")-LEN(SUBSTITUTE(UPPER(" "&editeddata!$C$2:$C$1731&" "),UPPER(" "&B2&" "),"")))/LEN(" "&B2&" "))

    Where data are in editeddata!$C$2:$C$1731 and the word to look up is in B2. I dragged this formula down and while the B2 changes to B3, B4... like I wanted, I figured out how to insert $ in the data sheet range so the data reference stays the same. Wala!!! It worked!!!!

    Thank you thank you thank you again!!!

  6. #6
    Registered User
    Join Date
    10-14-2019
    Location
    Honolulu, Hawaii
    MS-Off Ver
    Office Professional Plus 2016
    Posts
    3

    Re: Tweak formula to be non- case sensitive and also counts only exact words

    Thank you very much for your response!!! I really appreciate it and have found the answer with the previous user's suggestion. I am sure yours might work too! Thank you again Menem!

+ 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. Need Case Sensitive VLOOKUP FOrmula
    By jobie804 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-15-2017, 12:10 PM
  2. making a formula case sensitive
    By icylemontea in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-26-2014, 06:40 AM
  3. [SOLVED] How does this Case Sensitive Lookup Work using 1/Exact?
    By Trevasaurus in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-06-2013, 04:05 PM
  4. how to match case sensitive words in excel
    By genetist in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-04-2013, 03:36 AM
  5. VLOOKUP help that is case sensitive, exact, and allows text and numbers
    By dafacta in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-08-2013, 12:26 PM
  6. [SOLVED] How do i make this formula not case sensitive?
    By Zargon in forum Excel General
    Replies: 15
    Last Post: 07-15-2012, 07:33 PM
  7. excel exact command should not be case sensitive
    By keabu in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-17-2006, 01:15 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