+ Reply to Thread
Results 1 to 11 of 11

Include Year and Month in a INDEX Formula

  1. #1
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Brazil
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    268

    Include Year and Month in a INDEX Formula

    The below formula is working fine, but I would like a few changes. I would like to include the YEAR and MONTH. I have basically two workbooks:

    1 - Called Master_01 --> this one is where my below formula is located.
    2 - Called Input for Pilot_v01 where I have the data for the formula.

    Here is the formula which is located on Pilot_v01 workbook:
    =INDEX('[Input for Pilot_v01.xlsx]LPAR_WCAP'!$F$2:$G$300000,SMALL(IF('[Input for Pilot_v01.xlsx]LPAR_WCAP'!$F$2:$G$300000=A2,ROW('[Input for Pilot_v01.xlsx]LPAR_WCAP'!$F$2:$G$300000)-ROW('[Input for Pilot_v01.xlsx]LPAR_WCAP'!$F$2)+1,ROW('[Input for Pilot_v01.xlsx]LPAR_WCAP'!$G$300000)+1),1),2)

    Here is what I want to include on above formula
    - YEAR: 2013(for example the year will be on Cell A4 of Master_01 workbook) which its data is on ('[Input for Pilot_v01.xlsx]LPAR_WCAP'!$D$2:$D$300000)
    - MONTH: 01 (will be on cell A5 of Master_01 workbook)) which its data is on ('[Input for Pilot_v01.xlsx]LPAR_WCAP'!$E$2:$E$300000)

  2. #2
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Brazil
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    268

    Re: Include Year and Month in a INDEX Formula

    Can Anyone help me please? I tried with this, but not working:

    =INDEX(InputLPAR!$F$2:$G$300000,SMALL(IF(InputLPAR!$F$2:$G$300000=A2*InputLPAR!$F$2:$G$300000=B2*InputLPAR!$F$2:$G$300000=C2,ROW(InputLPAR!$F$2:$G$300000)-ROW(InputLPAR!$F$2)+1,ROW(InputLPAR!$G$300000)+1),1),2)

  3. #3
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Brazil
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    268

    Re: Include Year and Month in a INDEX Formula

    Can Anyone help me please? I tried with this, but not working:

    =INDEX(InputLPAR!$F$2:$G$300000,SMALL(IF(InputLPAR!$F$2:$G$300000=A2*InputLPAR!$F$2:$G$300000=B2*InputLPAR!$F$2:$G$300000=C2,ROW(InputLPAR!$F$2:$G$300000)-ROW(InputLPAR!$F$2)+1,ROW(InputLPAR!$G$300000)+1),1),2)

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

    Re: Include Year and Month in a INDEX Formula

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  5. #5
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Brazil
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    268

    Re: Include Year and Month in a INDEX Formula

    Sorry I posted twice the same thing, network issues here

  6. #6
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Brazil
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    268

    Re: Include Year and Month in a INDEX Formula

    I changed only the Sheet References.... and tried to use more values on IF function, but does not work.

  7. #7
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Brazil
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    268

    Re: Include Year and Month in a INDEX Formula

    Sure Pepe Le Mokko, I will do that

  8. #8
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Brazil
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    268

    Re: Include Year and Month in a INDEX Formula

    Here is my sample workbook with explanation of what I need. Basically it needs to match value. I have two sheets, Main and Data. The results should be on main in the green area.
    Attached Files Attached Files

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

    Re: Include Year and Month in a INDEX Formula

    I also have some problems uploading
    Enter
    Please Login or Register  to view this content.
    in G2 and commit with Ctrl+Shift+Enter then drag right as far as needed

  10. #10
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Brazil
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    268

    Re: Include Year and Month in a INDEX Formula

    Wow, fantastic!! this is really crazy!! Could you explain a little bit how does it know when it is the second value, third and so forth?

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

    Re: Include Year and Month in a INDEX Formula

    As it is an array formula,the IF part creates an array containing the row number where the condition is satisfied. The SMALL function then extracts the value corresponding to the ranking defined by column()-6
    In col G, this returns 1, so SMALL returns the first value of the array. As you drag to the right, column()-6 becomes 2 retrieving the 2nd value, etc..

    INDEX does the rest. The "Evaluate formula" tool will help you see what's happening and this MS page will also help

    And BTW, your idea of concatenating values is most useful and makes things easier rep for that!). A helper column often works great

+ 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