+ Reply to Thread
Results 1 to 12 of 12

Excel Question about If, Vlookup, and If Error

  1. #1
    Registered User
    Join Date
    01-21-2016
    Location
    NJ
    MS-Off Ver
    2014
    Posts
    8

    Excel Question about If, Vlookup, and If Error

    Hi All,

    I am trying to accomplish something at work.

    Basically what I am trying to do is.

    If there is a value in Cell B1, do a vlookup and provide me with the information I need in cell B2. If there is no value in cell B1 leave cell B2 blank as well.

    However IF, there is a value in cell B1 and the vlookup returns me an error because whats in cell B1 isn't on my data set of what I am looking up give me a message of "take action"

    Thanks!

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,633

    Re: Excel Question about If, Vlookup, and If Error

    In B2 try =IF(B1="","",IF(ISNA(your_formula),"take action", your_formula))

    (replace " your_formula" with VLOOKUP(B1,.... )

  3. #3
    Registered User
    Join Date
    01-21-2016
    Location
    NJ
    MS-Off Ver
    2014
    Posts
    8

    Re: Excel Question about If, Vlookup, and If Error

    This is the formula I currently have

    =IF(B21>0,IFERROR(VLOOKUP(B21,'XYZ'!A:B,2,0),"Take Action")," ")

    However even if nothing is in cell B21 I am getting the "Take Action" message

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.96 for Mac MS 365
    Posts
    8,697

    Re: Excel Question about If, Vlookup, and If Error

    this will return a value or a message, I've never tried it for all three of an error or a message or a value...
    =IF(IFERROR(VLOOKUP(B1,C:C,1,FALSE),"")="","take action",VLOOKUP(B1,C:C,1,FALSE))
    this will return a blank or a message...
    =IF(IFERROR(VLOOKUP(B1,C:C,1,FALSE),"")="","take action","")
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  5. #5
    Forum Contributor
    Join Date
    10-10-2014
    Location
    New Jersey
    MS-Off Ver
    2010 & 2013
    Posts
    276

    Re: Excel Question about If, Vlookup, and If Error

    I attached an example but assuming that your data is in columns D and E use this:

    Please Login or Register  to view this content.
    Lookup for shankys_14.xlsx

  6. #6
    Registered User
    Join Date
    01-21-2016
    Location
    NJ
    MS-Off Ver
    2014
    Posts
    8

    Re: Excel Question about If, Vlookup, and If Error

    Quote Originally Posted by Teblol View Post
    I attached an example but assuming that your data is in columns D and E use this:

    Please Login or Register  to view this content.
    Attachment 441893
    Sorry I am still getting take action even tho B1 is empty. Could is be because I have a if formula in B1? The formula I have in B1 is =IF('Xyz'!B39>0,'xyz'!B39,"")

  7. #7
    Forum Contributor
    Join Date
    10-10-2014
    Location
    New Jersey
    MS-Off Ver
    2010 & 2013
    Posts
    276

    Re: Excel Question about If, Vlookup, and If Error

    Try this:

    Please Login or Register  to view this content.

  8. #8
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.96 for Mac MS 365
    Posts
    8,697

    Re: Excel Question about If, Vlookup, and If Error

    Mine might work for you if you make it this way (untested) =IF(B1="","",if(IFERROR(VLOOKUP(B1,C:C,1,FALSE),"")="","take action",VLOOKUP(B1,C:C,1,FALSE)))

  9. #9
    Registered User
    Join Date
    01-21-2016
    Location
    NJ
    MS-Off Ver
    2014
    Posts
    8

    Re: Excel Question about If, Vlookup, and If Error

    Quote Originally Posted by Teblol View Post
    Try this:

    Please Login or Register  to view this content.
    This worked, thank you!

  10. #10
    Forum Contributor
    Join Date
    10-10-2014
    Location
    New Jersey
    MS-Off Ver
    2010 & 2013
    Posts
    276

    Re: Excel Question about If, Vlookup, and If Error

    No problem. Glad to help.

    If that takes care of your original question, please select Thread Tools from the menu above your first post and mark this thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

  11. #11
    Registered User
    Join Date
    01-21-2016
    Location
    NJ
    MS-Off Ver
    2014
    Posts
    8

    Re: Excel Question about If, Vlookup, and If Error

    Thanks, marked back as unsolved because I didn't want to open a new thread. Is there anyway that not only does it say Take Action it also highlights the cell yellow or red?

  12. #12
    Forum Contributor
    Join Date
    10-10-2014
    Location
    New Jersey
    MS-Off Ver
    2010 & 2013
    Posts
    276

    Re: Excel Question about If, Vlookup, and If Error

    Yes. You can do this with conditional formatting. Select the cell. Go to conditional formatting. New rule. Choose format only cells that contain. Switch cell value to specific text. Type Take Action into the bar. Click format and change the fill to whatever color you want.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel Macro/VBA Question (receiveing an error message)
    By kmwice in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-17-2015, 01:59 PM
  2. Excel VLOOKUP Function question
    By elowther in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-19-2013, 12:56 PM
  3. Replies: 2
    Last Post: 11-20-2012, 11:14 PM
  4. If statements / vlookup question / error message
    By rpmulli in forum Excel General
    Replies: 10
    Last Post: 06-04-2012, 07:32 PM
  5. Excel (value) error question.
    By GILLAN in forum Excel General
    Replies: 6
    Last Post: 11-02-2008, 09:06 PM
  6. Question re Vlookup function within Excel.
    By 007juk in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-07-2007, 07:28 AM
  7. Excel VLookup Question
    By RudyStyles in forum Excel General
    Replies: 5
    Last Post: 08-03-2007, 06:40 PM

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