Results 1 to 9 of 9
  1. #1
    cliff.clayman is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    55

    Lightbulb How can I convert this Excel formula to an Access query?

    I have a formula in Excel that I would like to know how it can be converted to be done in an Access query instead.

    The Excel formula is:

    =ISNUMBER(SEARCH(B1,A1))



    I am checking to see if the value of B1 exists in A1. Is there an Access function that does that same thing?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I haven't used the SEARCH() function in Excel, but it sounds like the InStr() function in Access. IsNumeric() is probably the Access equivalent of ISNUMBER()
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    I wonder if an IIf() function would be useful. Maybe add some wildcards. Just a wild guess, though.
    IIf(Column1 = Column2, "Yes", "No")
    https://msdn.microsoft.com/en-us/lib.../gg264412.aspx

  4. #4
    cliff.clayman is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    55
    I don't want to know if the columns match, I need to know if a value from one field exists in another. For example:
    Full Name
    John Smith

    Last Name
    Smith

    I want to compare the Last Name field with the Full Name field to see if "Smith" is in both.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Did you try InStr()?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    cliff.clayman is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    55
    I don't want to extract anything; I want to compare two fields.

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by cliff.clayman View Post
    I don't want to extract anything; I want to compare two fields.
    Here is a reference
    https://msdn.microsoft.com/EN-US/lib.../gg264811.aspx

  8. #8
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,928
    use the instr function which is similar to the excel Search function (note the strings are the other way round), but returns 0 if not found rather than #Value, so you don't need the isnumeric function

    =instr("ABCDE","C") will return 3
    =instr("ABCDE","Z") will return 0

    so instr("ABCDE","C")=0 will return false

  9. #9
    cliff.clayman is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    55
    Yes, that worked! Thank you.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 19
    Last Post: 07-13-2015, 10:15 AM
  2. Replies: 3
    Last Post: 07-10-2015, 01:19 PM
  3. Excel Formula into Access Query
    By dr4ke in forum Queries
    Replies: 7
    Last Post: 06-25-2012, 06:46 AM
  4. Replies: 5
    Last Post: 12-14-2011, 08:24 AM
  5. Replies: 0
    Last Post: 09-03-2009, 01:58 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums