+ Reply to Thread
Results 1 to 8 of 8

problem when FIND doesn't find anything

  1. #1
    Registered User
    Join Date
    10-11-2013
    Location
    hamburg
    MS-Off Ver
    Excel 2003
    Posts
    4

    problem when FIND doesn't find anything

    Hey!

    first: excuse my english, I tried my best

    I would appreciate any help on the following problem:

    In the A columns I have texts which look like this:
    A1 "Hand 27s - bet: 30%, check: 70%"
    A2 "Hand 98o - bet: 100%
    A3 "Hand T7 - call: 88%, raise: 5%, fold: 7%)
    etc.

    so I have values vor bet, check, call, raise, fold if its > 0%)
    in the next columns I want to read the percentages (B,C,D,E,F - bet, check, call, raise, fold)

    example for B1 (look for percentage of bet):

    =IF(A1<>"";MID(A1;FIND("bet:";A1)+5;FIND("%";A1;FIND("bet:";A1)+5)-(FIND("bet:";A1)+5));"")

    explanation:
    - it checks if there is any text in the field - it not it does nothing instead of giving "#VALUE!"
    - it looks for the position of "bet". +5 is where the percentagenumber starts (check would be +7, fold +6 and so on)
    -after that it figures out the length by looking for the "%" after "bet" and subtracting the position of "bet" from the position of the % after "bet"

    problem: when FIND doesn't find the text it gives out #VALUE! for the field.
    I've heard that ISTEXT oder ISNUMBER might work, but I don't know how to implement that in my formula.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,604

    Re: problem when FIND doesn't find anything

    Try it like this:

    =IF(A1<>"";IF(ISNUMBER(FIND("bet:";A1);MID(A1;FIND("bet:";A1)+5;FIND("%";A1;FIND("bet:";A1)+5)-(FIND("bet:";A1)+5));"");"")

    Note that FIND is case-sensitive, so you might like to use SEARCH instead if "bet" might be "Bet".

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    10-11-2013
    Location
    hamburg
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: problem when FIND doesn't find anything

    hey Pete,

    thanks, I tried it but now I get: Err:508, probably because it has multiple FIND's and they all would give a #VALUE! (maybe not )

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,604

    Re: problem when FIND doesn't find anything

    Are you trying to do this through a macro?

    Can you attach your workbook? The FAQ describes how to.

    Pete

  5. #5
    Registered User
    Join Date
    10-11-2013
    Location
    hamburg
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: problem when FIND doesn't find anything

    here we go:

    in the bet column I'm using your solution. In check the old formula is used.

    test.xls

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,604

    Re: problem when FIND doesn't find anything

    Sorry, I missed a bracket out:

    =IF(A2<>"";IF(ISNUMBER(FIND("bet:";A2));MID(A2;FIND("bet:";A2)+5;FIND("%";A2;FIND("bet:";A2)+5)-(FIND("bet:";A2)+5));"");"")

    As you have a header row and are putting this formula in E2, I've also changed the references to A2 compared with the other formula that I gave you.

    If you want the formula to return actual percentages, then you can change it to this:

    =IF(A2<>"";IF(ISNUMBER(FIND("bet:";A2));MID(A2;FIND("bet:";A2)+5;FIND("%";A2;FIND("bet:";A2)+5)-(FIND("bet:";A2)+5))/100;"");"")

    and format the cell as percentage with 0dp before copying down.

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    10-11-2013
    Location
    hamburg
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: problem when FIND doesn't find anything

    Pete, I love you

    thanks a lot

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: problem when FIND doesn't find anything

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. Ctrl Find Doesn't Find Words in Xls
    By nothingisthis in forum Excel General
    Replies: 3
    Last Post: 06-14-2011, 04:09 AM
  2. [SOLVED] Despite data existing in Excel 2002 spreadsheet Find doesn't find
    By AnnieB in forum Excel General
    Replies: 1
    Last Post: 06-15-2006, 09:15 PM
  3. Stopping errors when a find statement doesn't find!
    By matpj in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-25-2006, 10:23 AM
  4. RE: Edit-Find doesn' work, don't know the problem.
    By Gary''s Student in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 09-16-2005, 08:05 PM
  5. Edit-Find doesn' work, don't know the problem.
    By micasidulce in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 09-16-2005, 08:05 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