+ Reply to Thread
Results 1 to 3 of 3

Making If(find) statements work with shifting cells

  1. #1
    Registered User
    Join Date
    04-19-2012
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    1

    Making If(find) statements work with shifting cells

    Hi,

    I'm trying to get an if(find) statement to work where the target cell is an index, and thus changes when someone chooses are different variable. To be exact, I am building a dashboard where I need to show something for the last 12 months rolling. The 12 months depends on which current month is chosen via a drop down bar (which links to an indexed cell). I've entered the following formula:

    =if(find("JAN",K6),"Feb-2011","") where K6 is my indexed cell and it works properly.

    However if I want to expand this formula to look for any other months:

    =if(find("JAN",K6),"Feb-2011",if(find("FEB",K6),"Mar-2011",etc,if(find("DEC",K6),"Jan-2012","") and I can't get it to work.

    In fact, as soon as I add the second if string, it doesn't seem to work correctly for me.

    The goal is for this to work and then build a seperate chart with which to use as a vlookup source for a graph.

    Any suggestions? Any help would be appreciated!

    Thanks,

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Making If(find) statements work with shifting cells

    try somethign like this..

    =INDEX({"Feb-2012","Mar-2012","Apr-2012"},MATCH(K6,{"JAN","FEB","MAR"},0))

    you just need to extend the arrays to the full year.

    or you could put the arrays in a set of cells, and just reference it
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Making If(find) statements work with shifting cells

    if your dates are actual dates, you could use something like month()+1...and month+13... to select your start and end dates, andthen build yout formula around that?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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