Hi,
I have built a profit and loss statement into a databse layout in excel: In each row of data, Column A is business unit - Column B is Month - Column C is expense type A amount, Column D is expense type B amount, etc.
For example, A2 would be "Accounting" (department), B2 would be "January" (month), C2 would be $400 (Amount in Office Supplies - 6500) and D2 would be $25 (Amount in IT Harddware - 6200). There is a row per department, per month on the "detail" tab of my worksheet (database), so if Accounting had expenses for February, they'd be on row 3 in this example.
I need the profit and loss (traditional format, that has a column for the expense category number, ex above 6500) to return the value of the specific business unit's expense in a given month. For example, if I was building a profit and loss statement for Accounting for January's column, it should return $400 on the row for Office Supplies and $25 for IT Hardware.
so far, I've been able to query total expense, just can't get it narrowed down by department as well as month - below is the formula for the total expenses - detail!K represents the column for month on the database tab, C2 here represents month on the P&L tab, B24 represents the cell on the P&L tab where the expense category number is stored, and row 1 on the detail tab is where the expense category is stored on the database tab.
=IFERROR((SUMIF(detail!$K$2:$K$2000, C$2, INDEX(detail!$U$3:$BG$2000, 0, MATCH($B24, detail!$U$1:$BG$1, 0)))),0)
Any help from you in tremendously appreciated!
Bookmarks