+ Reply to Thread
Results 1 to 4 of 4

Need a formula that will check a cell against a worksheet and return a certain value

  1. #1
    Registered User
    Join Date
    03-20-2013
    Location
    Tucson, AZ
    MS-Off Ver
    Excel 2010
    Posts
    2

    Need a formula that will check a cell against a worksheet and return a certain value

    ExcelHelpSheet.xlsI've been working on this for the past two weeks and I finally give up! I can't seem to find a similar question that I can tweak to fit what I need. Here is my problem:

    I have a list of agricultural commodities that are commonly imported. Some of these are considered "NARP" commodities, and some are not. Here is what I want to do:

    Look at the commodity in column A and compare it to a list of all "NARP" commodities, which I've made on a second worksheet. If the commodity is on that work sheet, I want it to return the word "NARP." If it is not, I want it to return the word "non-NARP."

    I've tried the VLOOKUP function [=VLOOKUP(A1,NARP!A1:B33,2)] but it tells me NARP regardless if it is on the list or not. I've left the code in G1; but Avocado is not on the list, so it should not come back as NARP.

    My guess from the reading I've done is that I need an IF function, but I have had even less luck with that then the VLOOKUP!

    I would greatly appreciate any help on this!
    Last edited by Kikei; 03-20-2013 at 10:21 PM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Need a formula that will check a cell against a worksheet and return a certain value

    Kikei,

    Welcome to the forum!
    The function you're looking for is the Countif() function. Using your provided example workbook, in sheet 'Data' cell G1 and copied down would be this formula:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Contributor
    Join Date
    09-24-2012
    Location
    York, England
    MS-Off Ver
    Excel 2003/07/10
    Posts
    165

    Re: Need a formula that will check a cell against a worksheet and return a certain value

    Kikei
    Try this mod to your formula:

    =IFERROR(VLOOKUP(A1,NARP!$A$1:$B$33,2,FALSE),"non-NARP")

    I placed in col G and dragged down to row 34.

    Hooe that helps
    Herc

  4. #4
    Registered User
    Join Date
    03-20-2013
    Location
    Tucson, AZ
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Need a formula that will check a cell against a worksheet and return a certain value

    SOLVED!

    Thank you both! I tried out both ways and they do what I need them to. Thank you!!!

+ 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