+ Reply to Thread
Results 1 to 6 of 6

I want to develop a formula that mixes "If" and "Vlookup" functions

  1. #1
    Registered User
    Join Date
    03-12-2012
    Location
    Manchester, England
    MS-Off Ver
    MS 365
    Posts
    52

    I want to develop a formula that mixes "If" and "Vlookup" functions

    I have a requirement to lookup a value in a column, if present, return the number "1" else return the number "0".
    Does anyone have any ideas how this can be achieved?
    Thanks
    Chris

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: I want to develop a formula that mixes "If" and "Vlookup" functions

    Hi Chris,

    Welcome to the forum.
    This can be achieved using error handler like If ISError :-

    Use the following formula:-

    =IF(ISERROR(VLOOKUP(E3,$C$1:$D$50,2,0)),0,1)

    where, E3 is the value you want to look for in range C1 to D50. thanks.

    regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: I want to develop a formula that mixes "If" and "Vlookup" functions

    Try

    =--NOT(ISNA(MATCH(some_value,some_column,0)))

  4. #4
    Registered User
    Join Date
    03-12-2012
    Location
    Manchester, England
    MS-Off Ver
    MS 365
    Posts
    52

    Re: I want to develop a formula that mixes "If" and "Vlookup" functions

    Hi Dilipandey
    I have created the following formula based on your reply:
    =IF(ISERROR(VLOOKUP(A3,'19 Jul 2011'!A:A,2,0)),0,1)

    The value I am looking for is in cell "A3"
    The array I want to look in is on worksheet "19 Jul 2011" in column A.
    If the value is there I want Excel to return the number "1" or, if not, the number "0".
    The above formula is returning "0" for every row even the ones where the value is present.
    Could you tell me what the "2,0" after the Column range does? I wonder whether that is the issue.
    Thanks
    Chris

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: I want to develop a formula that mixes "If" and "Vlookup" functions

    try this:
    =IF(ISERROR(MATCH(A3,'19 Jul 2011'!A:A,0),0,1)
    Quang PT

  6. #6
    Registered User
    Join Date
    03-12-2012
    Location
    Manchester, England
    MS-Off Ver
    MS 365
    Posts
    52

    Re: I want to develop a formula that mixes "If" and "Vlookup" functions

    Great.
    Worked a treat.
    Thanks Bob,
    Regards
    Chris

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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