+ Reply to Thread
Results 1 to 5 of 5

Parsing text using ISNUMBER and FIND

  1. #1
    Registered User
    Join Date
    12-03-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    19

    Parsing text using ISNUMBER and FIND

    I need to sort through thousands of strings to classify them as citations for books, journal articles, or internet based sources.

    The final formula in column F in the worksheet attached is supposed to classify the string as "Book" if "Ed." was found in the String in Column A, "Journal Article" if one or more of the numbers (0-9) were found in the substring in Column D, "Internet" if "http" (but no number) was found next to the colon. If no numbers were found next to the colon, and no http was found either, it was to be called "Other."

    As you can in the attachment, the classification seems to be going well until it encounters Row #15. This is actually a journal article, but is classified as "Other." This is perhaps because, apart from the numbers next to the colon, there also are some alpha characters ("ds"), but I don't understand why this should matter.
    Attached Files Attached Files
    Last edited by AliGW; 02-14-2020 at 01:01 PM. Reason: Irrelevant section of title removed.

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Question regarding parsing text using ISNUMBER and FIND

    Try this in F2 and fill down. It changes a lot of the results, but row 15 is now Journal Article.

    Untested
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  3. #3
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Question regarding parsing text using ISNUMBER and FIND

    Step through the formula with the Evaluate Formula tool. You will see that this part -- IF(ISNUMBER(FIND({0,1,2,3,4,5,6,7,8,9},D9)),"Journal Article","Other") -- returns an array of "Journal Article" and "Other", depending on whether or not the numbers were found. The first result of this array will make it into the final result.

    It is by pure chance that some Journal Articles have a zero in the text in column D, and the first entry in the FIND result array is "Journal Article".

    You want to check for ANY number, so you need to convert the result of the FIND into a series of 0 for not found and 1 for found, then sum that.

    Try

    =IF(ISNUMBER(SEARCH("ed.",A2)),"Book",IF(E2="No",IF(SUM(ISNUMBER(FIND({0,1,2,3,4,5,6,7,8,9},D2))*1),"Journal Article","Other"),"Internet"))

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,919

    Re: Question regarding parsing text using ISNUMBER and FIND

    Also, you can use the OR () function.

    =IF(ISNUMBER(SEARCH("ed.",A2)),"Book",IF(E2="No",IF(OR(ISNUMBER(FIND({0,1,2,3,4,5,6,7,8,9},D2))),"Journal Article","Other"),"Internet"))

  5. #5
    Registered User
    Join Date
    12-03-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    19

    Re: Question regarding parsing text using ISNUMBER and FIND

    Thanks all for the answers. Adding "OR" as suggested by @Phuocam seems to do the trick, but I also appreciate the other answers. In particular, @teylyn's was educational. Thank you.

+ 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. Nestled IF(ISNumber(... forumla question
    By cbarth in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-04-2015, 12:39 PM
  2. [SOLVED] If, ISNUMBER, SEARCH Question! Help!
    By gonoles98 in forum Excel General
    Replies: 5
    Last Post: 08-08-2014, 12:51 PM
  3. Replies: 3
    Last Post: 11-21-2011, 06:44 AM
  4. Text parsing, find string after : character
    By proepert in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-14-2010, 10:46 PM
  5. IF(ISNumber) Question
    By mikera in forum Excel General
    Replies: 4
    Last Post: 01-28-2010, 04:05 PM
  6. If(isnumber(search question
    By Wskip49 in forum Excel General
    Replies: 2
    Last Post: 12-02-2009, 02:14 PM
  7. [SOLVED] IsNumber question
    By Patrick Simonds in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-09-2005, 02:05 PM

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