Results 1 to 7 of 7
  1. #1
    funzone is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2017
    Posts
    4

    substitute VLOOKUP that’s done in Excel

    Hi, I am trying to substitute VLOOKUP that’s done in Excel for something that can be done in Access instead. As an example: I have several people who have several types of education, each individual might have 1-5 types of education. I do not need to see individuals that already have “ED” – education type. Since several people have several types of education, I cannot just eliminate “ED”, since the remainder of education type will appear in the results. I need to see everyone who doesn’t have “ED” education type. I am not sure what type of criteria I need to use here. Today, I create a VLOOKUP in Excel and I would like to change that going forward.
    P.S I cannot change tables.
    Let me know if you have any suggestions/questions.
    Thanks.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    the equivalent of vlookup for access is dlookup - see this link https://www.techonthenet.com/access/...in/dlookup.php

    but usually in access you would use a query - without knowing what your tables look like, perhaps something like

    Code:
    SELECT tblPeople.*
    FROM tblPeople LEFT JOIN (SELECT peopleFK FROM tblEducation WHERE EducationType="ED") AS hasED ON tblPeople.peoplePK=hasED.peopleFK
    WHERE hasED.PeopleFK IS Null
    but otherwise to assist you will need to provide details of your tables, some example data and the required outcome

  3. #3
    funzone is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2017
    Posts
    4
    Thanks Ajax. Dlookup won't work in this case. Everyone has an education type, none of the people have a null.
    I already have a query created but it needs a criteria on the Education Type.
    ID Education Type
    12345 EDU
    12345 CERT
    12345 PCP
    24568 EDU
    24568 CERT
    24568 PCP
    78956 PCP
    78956 CERT
    78956 TEST

    I need to only see ID 78956, since it doesn't have EDU.

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    I need to only see ID 78956, since it doesn't have EDU.
    which is what my query does - suggest try it and see. If you have tried it, post the sql you actually used

  5. #5
    funzone is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2017
    Posts
    4
    See below. I appreciate any help.

    SELECT TBL_EMP.EMP, TBL_EMPCODE.ED_TYPE
    FROM TBL_EMP INNER JOIN TBL_EMPCODE ON TBL_EMP.EMP = TBL_EMPCODE.EMP;

  6. #6
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    just substitute the table and field names in my query for the ones in yours. Use my query since yours is nothing like what I suggested

    e.g. replace tblPeople in my query with TBL_EMP, etc

  7. #7
    funzone is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2017
    Posts
    4
    Table Emp doesn't have Education Type ED
    Maybe you can correct this in anyway.

    Please see below:

    SELECT TBL_EMP.EMP, TBL_EMPCODES.EDUC_TYPE
    FROM TBL_EMPCODES LEFT JOIN TBL_EMP ON TBL_EMPCODES.EMP = TBL_EMP.EMP
    WHERE TBL_EMPCODES.R_TYPE Like "ED" AS hasED ON TBL_EMP.EMP=hasED.EMP;

    Thanks !

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

Similar Threads

  1. vlookup macro in excel
    By Jaik in forum Macros
    Replies: 1
    Last Post: 09-24-2016, 03:08 PM
  2. Excel problem (vlookup)
    By sdc1234 in forum Misc
    Replies: 3
    Last Post: 02-20-2015, 10:53 AM
  3. Pasting to Excel For VLOOKUP
    By JeffGeorge in forum Access
    Replies: 2
    Last Post: 03-27-2014, 10:54 AM
  4. Access and the concept VLOOKUP in Excel
    By Bob Blooms in forum Access
    Replies: 1
    Last Post: 08-27-2012, 12:28 PM
  5. Excel VLookup vs Access IIF statement
    By Huddle in forum Queries
    Replies: 9
    Last Post: 02-02-2012, 11:00 AM

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