Hi,
I have company accounts with rows listed by its general ledger code (e.g.: 19999 for revenue, 39999 for overheads) and columns by whole months in 2019.
The following code returns me the value for the general ledger code 45999 for the month column it sits in ('Date' = Oct-19):
=-INDEX('TB'!F:Q,MATCH(45999,'TB'!B:B,0),MATCH(Date,'TB'!F1:Q1,0))
However I want to return multiple general ledger codes, in theory it would look like this, adding the different general ledger code results together:
=-INDEX('TB'!F:Q,MATCH({45999,46350,47956,47283},'TB'!B:B,0),MATCH(Date,'TB'!F1:Q1,0))
This of course does not work.
The only way I have managed this is using hlookup with the row number the general ledger code sits on, for example 45999 sits on row 437:
-SUMPRODUCT(HLOOKUP(Date,'TB'!F:Q,{437,467,486,475},0))
This is inefficient as you can't add in new rows without messing up this formula. I am looking for a way to achieve this without using much more resources than the above hlookup uses. Can anyone help?
Bookmarks