+ Reply to Thread
Results 1 to 7 of 7

Combining VLOOKUP and IF statements

  1. #1
    Forum Contributor
    Join Date
    02-14-2008
    Location
    Manchester, England
    MS-Off Ver
    2007
    Posts
    110

    Combining VLOOKUP and IF statements

    Hello

    I'm trying to write a formula that uses a lookup. If the result of the lookup is a "." then I want to return a 0. Otherwise I want to return whatever value is there.

    Having difficulty getting this to work. Can anyone help.

    Thanks
    Last edited by Dan27; 04-14-2010 at 06:44 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,592

    Re: Combining VLOOKUP and IF statements

    Try this:

    =IF(VLOOKUP(C1, M1:N12, 2, FALSE)=".", 0, VLOOKUP(C1, M1:N12, 2, FALSE))

  3. #3
    Forum Contributor
    Join Date
    02-14-2008
    Location
    Manchester, England
    MS-Off Ver
    2007
    Posts
    110

    Re: Combining VLOOKUP and IF statements

    I've tried this but it isn't working. It's still returning a "."

    Here's my formula as entered

    =IF(VLOOKUP(D2,[TEST_v3.xls]DATA!$A:$AK,31,0)=".","0",VLOOKUP(D2,[TEST_v3.xls]DATA!$A:$AK,31,0))

    Any ideas?

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,592

    Re: Combining VLOOKUP and IF statements

    Can you upload example?

  5. #5
    Forum Contributor
    Join Date
    02-14-2008
    Location
    Manchester, England
    MS-Off Ver
    2007
    Posts
    110

    Re: Combining VLOOKUP and IF statements

    Thanks, your formula works. On the spreadsheet I was referencing a cheeky little space had popped in after the "." which is why it didn't seem to be working

    Thanks

  6. #6
    Registered User
    Join Date
    01-22-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Combining VLOOKUP and IF statements

    Hi, This formula was very useful. I am however trying to take it one step further. Can you please help me. This is what I am trying to do.

    If the result of the lookup is <2012 then I want it to say"Existing" which is happening but the next part is what is stumping me.

    If the result gives me a #N/A which basically means that there is no matching data, then I want to return "New".

    Is this possible?

    Thanks
    GV

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining VLOOKUP and IF statements

    GVishnu,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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