+ Reply to Thread
Results 1 to 4 of 4

Basic IF statement query

  1. #1
    Registered User
    Join Date
    09-19-2014
    Location
    Limerick Ireland
    MS-Off Ver
    2010
    Posts
    3

    Basic IF statement query

    Is an IF statement the correct way to go here
    I have 2 worksheets that I'm working on. I simply want to say if Sheet1 column
    C has the word ORANGES I want to return that rows values to sheet2.
    Example below of what to look like
    Now the other amateur question would be is there a way for it to be done so it does not
    return the false value.

    Sheet1

    A B C
    Test1 JAMES APPLES
    Test2 JOHN ORANGES
    Test3 DEAN PEARS

    Sheet2

    A B C
    FALSE FALSE FALSE
    Test2 JOHN ORANGES
    FALSE FALSE FALSE


    =IF(Sheet1!C2="ORANGES",Sheet1!A2:B2)

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

    Re: Basic IF statement query

    it appears you want a formula that will look up a value. If the value would be to the right of your value (oranges) you could use a vlookup, since it is to the left you would need an index/match.
    like this =INDEX(sheet1a:a,MATCH("oranges",sheet1c:c,0)) as a guess.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Basic IF statement query

    you need to put what you want displayed if its false

    eg
    =IF(Sheet1!C2="ORANGES",Sheet1!A2:B2,"No Oranges")

    Your formula however wont return B2 it only returns A2 into the cell, if you want both to be displayed in the cell then put Sheet1!A2 & Sheet1!B2
    If someone has helped you then please add to their Reputation

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

    Re: Basic IF statement query

    as a help, to deconstruct the formula, the first part =INDEX(sheet1a:a is saying this is the location for the value you want returned, the next part MATCH("oranges",sheet1c:c,0)) is saying that you want oranges (or the equivalent cell in sheet2 to be found in that area of sheet1 c:c and the 0 is saying give me an exact match.

    EDIT: and my assumption is based on the possibility that you won't have the exact same order between the two sheets. An if/then stmt will assume that your values in row 1 of sheet 1 will match the values in row 1 of sheet 2, if something else is there but your value is in row 2 then you will have problems.
    Last edited by Sam Capricci; 11-17-2014 at 08:15 AM.

+ 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 2007 : Basic Header Query: Why two &&'s?
    By The_Snook in forum Excel General
    Replies: 1
    Last Post: 12-06-2011, 09:21 AM
  2. Basic 1:1 query
    By cmf0106 in forum Access Tables & Databases
    Replies: 7
    Last Post: 11-19-2009, 12:11 PM
  3. Excel 2007 : Basic Excel query
    By chaudhas in forum Excel General
    Replies: 1
    Last Post: 07-14-2008, 09:05 AM
  4. basic autofilter query ,
    By khalid79m in forum Excel General
    Replies: 1
    Last Post: 01-09-2007, 05:43 PM
  5. Basic Last row query
    By khalid79m in forum Excel General
    Replies: 3
    Last Post: 01-08-2007, 08:15 AM

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