# Include Year and Month in a INDEX Formula

1. ## 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. ## 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. ## 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. ## 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. ## Re: Include Year and Month in a INDEX Formula

Sorry I posted twice the same thing, network issues here

6. ## 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. ## Re: Include Year and Month in a INDEX Formula

Sure Pepe Le Mokko, I will do that

8. ## 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.

9. ## 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. ## 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. ## 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

#### Thread Information

##### Users Browsing this Thread

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

#### 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