+ Reply to Thread
Results 1 to 13 of 13

Countif with a Long Text String

  1. #1
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Countif with a Long Text String

    Hi everyone,

    I'm trying to run a countif formula in a separate worksheet searching for a long text string. The text string is long enough that I can't copy the entire string into the Ctrl F Find function.

    =COUNTIF('Data Month 1'!C:C,F4)
    F4 = text string put together using the values of multiple adjascent cells. Total characters are over 26.

    Thanks!!

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Countif with a Long Text String

    Hi,

    So what's your question?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Countif with a Long Text String

    How can I adjust the countif formula to accept a very long text string? Sorry, I thought I made the issue evident. Thanks!

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Countif with a Long Text String

    Is there an issue with having it in a cell and referenced from there?

    Edit: wait - the limit is 255 characters. You have more than that?

    Regards
    Last edited by XOR LX; 06-25-2014 at 12:08 PM.

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Countif with a Long Text String

    To my knowledge, the limit of a text string in an argument of a function is 255 characters.

    Since you said the total characters are over 26, to me that indicates you are nowhere near that limit.
    So you CAN do
    =COUNTIF('Data Month 1'!C:C,"sometextstringupto255characterslong")

  6. #6
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Countif with a Long Text String

    hi Jonmo,

    thanks for the response. That's what I thought too. The text string is made up of of the value of a number of other cells. I've tried just using the value as well and it still didn't work. So worst case scenario lets say the text string is over 255 characters. Any way around this?

    Thanks,

  7. #7
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Countif with a Long Text String

    Ok, Describe "Doesn't work"
    Do you get an error? What error?
    Do you get the wrong result? What result DO you get, and what result did you expect?

    If the problem is the 255 character limit, you will get a clear error message saying that is the problem.
    If you don't get that error, then that is not the problem

    Post a sample workbook

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  8. #8
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Countif with a Long Text String

    I'm getting the #value error

  9. #9
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Countif with a Long Text String

    I think we'd need to see an actual workbook to be able to see if we can come up with some workarounds to the 255 character limit which work for your particular set-up.

    Regards

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Countif with a Long Text String

    Use SUMPRODUCT.

    =SUMPRODUCT(--('Data Month 1'!C2:C100=F4))

    Don't use the entire column as a reference. Use a smaller specific range.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  11. #11
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Countif with a Long Text String

    Hi Tony,

    I've tried that as well:

    =SUMPRODUCT(--('Data Month 1'!$C$2:$C$6000=H4))

    Still getting a #N/A error. Not sure what I'm missing here

  12. #12
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Countif with a Long Text String

    Are you adamant that you can't provide a workbook then?

    Regards

  13. #13
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Countif with a Long Text String

    Quote Originally Posted by Groovicles View Post
    Hi Tony,

    I've tried that as well:

    =SUMPRODUCT(--('Data Month 1'!$C$2:$C$6000=H4))

    Still getting a #N/A error. Not sure what I'm missing here
    Are there #N/A errors in the range?

    Try this array formula**:

    =SUM(IF(ISTEXT('Data Month 1'!$C$2:$C$6000),IF('Data Month 1'!$C$2:$C$6000=H4,1)))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

+ 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. Excel 2007 : Need help seperating text from a long string
    By duffy1807 in forum Excel General
    Replies: 2
    Last Post: 10-02-2011, 03:56 PM
  2. String function to get selective text from long string
    By MWHLFC in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-29-2011, 02:51 PM
  3. string function to get selective text from long string
    By MWHLFC in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-25-2011, 05:00 PM
  4. Combining selected text into a long string of text
    By bruce71101 in forum Excel General
    Replies: 1
    Last Post: 02-22-2011, 02:42 AM
  5. [SOLVED] long text string
    By jhahes in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-23-2006, 07:00 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