+ Reply to Thread
Results 1 to 8 of 8

Find JOIN and , between FROM and WHERE clause

  1. #1
    Registered User
    Join Date
    05-21-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2007
    Posts
    75

    Find JOIN and , between FROM and WHERE clause

    Hi,
    I am in a fix and following is my problem. I am novice in excel and I would need help in the following question.

    I have a list of 6000 queries in column A. All the queries are very different from each other.

    I need to find if there is the word "JOIN" or "," (comma) between the word FROM and WHERE in my query then return FALSE. However in some cases I do not have WHERE after the FROM clause in such a case I need to see if there is a "JOIN" after the FROM clause and if there is, then FALSE, no need to find "," (comma) in this case.

    Your help is really appreciated as I need to fix this asap.

    Thanks,
    Amandeep
    Last edited by amandeepsharma89; 02-11-2013 at 09:03 PM. Reason: Change of requirements

  2. #2
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Find JOIN and , between FROM and WHERE clause

    maybe a sample workbook copy on how the data are arrange with possible combination of those comma,where,and sample expected outcome...could help you receive responses.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  3. #3
    Registered User
    Join Date
    05-21-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2007
    Posts
    75

    Re: Find JOIN and , between FROM and WHERE clause

    I have attached a sample excel with the expected results.
    Waiting to hear back!

    Amandeep
    Attached Files Attached Files

  4. #4
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Find JOIN and , between FROM and WHERE clause

    can you check this one.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Note: not tested on other instances of combination possible.

  5. #5
    Registered User
    Join Date
    05-21-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2007
    Posts
    75

    Re: Find JOIN and , between FROM and WHERE clause

    Hi vlady,
    You are almost there. In the attached excel if you see in row 7 the answer should be TRUE as there is no "," or "JOIN" between FROM and WHERE but as there is a comma in WHERE. I am getting a FALSE (your formaula did not take this into consideration as I did not mention properly in my requirement). I put my requirement incorrectly and I am sorry for that.

    So, most of the part is correct but in some cases there can be a "," after WHERE. In this case when there is NO "JOIN" or "," between FROM and WHERE but a "," after WHERE then I want a TRUE.

    If this case is solved one of my major problem is solved.

    I would really appreciate your help in this.

    Waiting for your reply.

    Best,
    Amandeep
    Attached Files Attached Files

  6. #6
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Find JOIN and , between FROM and WHERE clause

    base on your given output try this now. Thanks.

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

  7. #7
    Registered User
    Join Date
    05-21-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2007
    Posts
    75

    Re: Find JOIN and , between FROM and WHERE clause

    Hi Vlady,
    The above formula is given me the wrong result for most cases but the one above that gave me the right result in most cases except the case that I gave you on row 7. Can you please look it up what is going wrong. In the sample excel sheet it works perfectly but not in the original sheet. In the original sheet 1st formula works better.
    Waiting for your reply.

    Best,
    Amandeep

  8. #8
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Find JOIN and , between FROM and WHERE clause

    hmmm.
    you can try this one
    =IFERROR(IF(SEARCH(",",A2,SEARCH("WHERE",A2,1)),TRUE),IF(OR(IFERROR(SEARCH("Join",A2,SEARCH("From",A2,1)),FALSE),IFERROR(SEARCH(",",A2,SEARCH("From",A2,1)),FALSE)),FALSE,TRUE)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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