INDEX MATCH (or X Lookup) by current Month

PaulyK

Board Regular
Joined
Aug 27, 2015
Messages
50
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
Hi,

I am creating a Status Report which shows different data from a series of separate spreadsheets. I am trying to show the result, for a specific project, in a specific month. The months are in the Column header only, which seems to be the challenge. I have tried an INDEX MATCH with an additional MATCH and even an XLOOKUP (although I haven't really used the formula before) but both return N/A.

Ideally I would like to use =Now() or similar to display the current Month (as opposed to the column I have used with the month in this example) as part of this as I would like the formula to update each month. Not sure how easy that is?

Suggestions?

Paul



Summary (in a separate Status Report sheet)
RAT Summary Example .xlsm
JKLM
3ProjectUpdated (Yes/No)MonthMethod
4Project 1#N/AApr-22INDEX MATCH MATCH
5Project 1#N/AApr-22XLOOKUP
Non-Compliance
Cell Formulas
RangeFormula
K4:K5K4=INDEX(tblNonCom16[[Apr-22]:[Aug-22]], MATCH([@Project],tblNonCom16[Name],0), MATCH([@Month],tblNonCom16[[#Headers],[Apr-22]:[Aug-22]],0))




Data Table
RAT Summary Example .xlsm
ABCDEFG
3Project IDNameApr-22May-22Jun-22Jul-22Aug-22
41001Project 1YesYesYesYesYes
51002Project 2YesYesYesYesNo
61003Project 3YesYesYesYesYes
71004Project 4YesYesNoNoNo
81005Project 5NoNoNoNoNo
91006Project 6YesYesYesYesYes
101007Project 7YesNoNoNoNo
111008Project 8YesYesYesNoNo
121009Project 9YesYesYesYesYes
131010Project 10YesYesYesYesYes
141011Project 11YesYesYesYesYes
151012Project 12NoNoNoNoNo
161013Project 13NoYesYesYesYes
171014Project 14YesYesNoNoNo
181015Project 15YesYesYesYesYes
191016Project 16YesYesYesYesYes
201017Project 17YesYesYesYesYes
211018Project 18NoNoNoNoNo
Non-Compliance
Cell Formulas
RangeFormula
C4:C21C4=IF(COUNTIFS(TblTime[[PROJECT NAME]:[PROJECT NAME]],$B4,TblTime[Apr-22],">0"),"Yes","No")
D4:D21D4=IF(COUNTIFS(TblTime[[PROJECT NAME]:[PROJECT NAME]],$B4,TblTime[May-22],">0"),"Yes","No")
E4:E21E4=IF(COUNTIFS(TblTime[[PROJECT NAME]:[PROJECT NAME]],$B4,TblTime[Jun-22],">0"),"Yes","No")
F4:F21F4=IF(COUNTIFS(TblTime[[PROJECT NAME]:[PROJECT NAME]],$B4,TblTime[Jul-22],">0"),"Yes","No")
G4:G21G4=IF(COUNTIFS(TblTime[[PROJECT NAME]:[PROJECT NAME]],$B4,TblTime[Aug-22],">0"),"Yes","No")
A4:A21A4=IFERROR(INDEX(TblProjAlloc[PROJECT NUMBER],MATCH([@Name],TblProjAlloc[PROJECT NAME],0))," ")
Named Ranges
NameRefers ToCells
'Project allocation'!_FilterDatabase='Project allocation'!$A$11:$B$50A4:A21
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C4:G21Cell Value="No"textNO
C4:G21Cell Value="Yes"textNO
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Maybe
Excel Formula:
=INDEX(tblNonCom16[[Apr-22]:[Aug-22]], MATCH([@Project],tblNonCom16[Name],0), MATCH(TEXT([@Month],"mmm-yy"),tblNonCom16[[#Headers],[Apr-22]:[Aug-22]],0))
 
Upvote 0
Solution
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Maybe
Excel Formula:
=INDEX(tblNonCom16[[Apr-22]:[Aug-22]], MATCH([@Project],tblNonCom16[Name],0), MATCH(TEXT([@Month],"mmm-yy"),tblNonCom16[[#Headers],[Apr-22]:[Aug-22]],0))
Ah yes, sorry I hadn't done that. I'm using 365 on Windows
 
Upvote 0
Thanks for that.
Did the suggestion I made work?
 
Upvote 0
Thanks for that.
Did the suggestion I made work?
It has thank you. I did get N/A to start with but I discovered that the problem is that the Column Headers despite being Custom Formatted as MMM-YY did not match my Date cell which was 01/04/22 for April. it was Formatted the same but the header column header was Apr-22.
My initial attempt at a formula infact worked as well if I pasted the column header into the MATCH Lookup cell.

Any idea if it is possible to not have a referenced cell for the Month - i.e if it is currently April, the April value is displayed (and then will update each month) It isn't a necessity though
 
Upvote 0
The headers in a table are always text so cell format is normally irrelevant, which is why I suggested using the TEXT function.
You can replace [@Month] in the formula with TODAY() although the formula will then be volatile.
 
Upvote 0
The headers in a table are always text so cell format is normally irrelevant, which is why I suggested using the TEXT function.
You can replace [@Month] in the formula with TODAY() although the formula will then be volatile.
ah I see. Learn something new every day! That makes sense.

Yes, I did try using =TODAY() previously (although aware it is Volatile) What is the 'risk' of using? Bearing in mind that the status report i will be using will only ever be required to show the current month's status? I am guessing that if someone saved a copy, it would change all the time?
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top