+ Reply to Thread
Results 1 to 7 of 7

Excel 2007 : IF Statement involving set of Data

  1. #1
    Registered User
    Join Date
    04-25-2012
    Location
    Minnesota, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Lightbulb IF Statement involving set of Data

    Hi all,

    I had a formula in mind but I think it's a little impropable on Excel. It may require some VBS, which I'm not too familiar with. Any help is greatly appreciated.

    Here is my dilema:

    Logical Statement: If cell F2 equals anything in a set of cells (Column D).

    If True: Return the data information from Column A of the same row. (I.E. If cell F2 equals a data set found in cell D5, then return the value in A5).

    If False: "Not Found"

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

    Re: IF Statement involving set of Data

    Hi SuperHmong,

    Welcome to the forum.

    You can use below formula to achieve the desired result:-

    =OFFSET($A$1,MATCH($F$2,$D$2:$D$5,0),0)

    Regards,
    DILIPandey

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

  3. #3
    Registered User
    Join Date
    04-25-2012
    Location
    Minnesota, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: IF Statement involving set of Data

    Can you explain the offset formula? I've never had to use it before.

    Also, I forgot to mention that cell F2 in Sheet 1 needs to match any value in Sheet 2. The data table is in Sheet 2 and Sheet 1 is being used as a user-interface tool to pull data information.

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: IF Statement involving set of Data

    Isn't this more appropriate since OFFSET() is volatile - INDEX() is not?

    =IFERROR(INDEX(Sheet2!A:A,MATCH(F2,Sheet2!D:D,0)),"Not Found")
    Last edited by Cutter; 04-25-2012 at 10:33 AM. Reason: Added sheet references

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

    Re: IF Statement involving set of Data

    Hi SuperHmong,

    Offset formula moves the reference from the source (initial referenced cell) to a target cell based on the number of rows / columns you provide.

    Syntax:-
    OFFSET(reference,rows,cols,height,width)

    so to explain better, =offset(a5,2,3) will provide the result from d7 cell.

    Regarding inclusion of sheet references in the formula you can revise the formula as:-

    =OFFSET(sheet2!$a$2,MATCH(sheet1!$F$2,sheet2!$D$2:$D$5,0),0)

    Note:- I have manually edited the formula without using excel, so you may need to correct the references at your end seeing this one.



    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  6. #6
    Registered User
    Join Date
    04-25-2012
    Location
    Minnesota, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: IF Statement involving set of Data

    The reference cell for Offset needs to be determined on it's own. I'm going to continue working on this, but thanks to everyone for putting me on the right path.
    Last edited by SuperHmong; 04-25-2012 at 11:30 AM.

  7. #7
    Registered User
    Join Date
    04-25-2012
    Location
    Minnesota, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: IF Statement involving set of Data

    Just an update: I finally got it to work. Thanks everyone!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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