Okay, I did a quick search on the forum in order to confirm wether someone had met the same problem or not, but didn't find anything.
So basically, the problem here is down to the proper use of INDEX/MATCH, but to give some backstory, here is my problem: I'm trying, through excel, to achieve results that were previously done by SQL requests on a database. I understand that, without VBA, I migh be asking too much. To make long story short, it was previously possible to extract any and all data from the database, but for the time being, I'm stuck with extractions generated in a way I cannot modify.
As you will see in the attached file, I'm working on expenses and profits, trying to compare different fiscal years. All accounts, may they be on the expense side (beginning with 6) or the profits side (beginning with 7), are always listed in the same B column. But depending on the structure I work on, it might not use the whole array of account. And if an account is not used, it is not simply filled with 0, it will rather not appear.
Same goes for the activity columns: in the attached example, there are only 2, COMM and OPS. But you could have much more, it all depends on the way the structure decided allocate its accounts. Again, it's the same mechanic used for the accounts: if an activity code is not used, it does not appear. This means that a code like OPS, which is always used, will always see its location within the spreadsheet change depending on the structure. As you can see, under an activity code, there are always the same 4 subcolumns, and thus, the activity code cell is a merged one.
In the end, what I'm looking for is Cell C3 in 'Analysis'!: a way to INDEX/MATCH a data with an evolving line, where I only take the "prefix" of the account, and an evolving column, with 2 headers.
INDEX/MATCH with 2 MATCH conditions seemed the way to go, but I might be wrong from the beginning.
Bookmarks