3D INDIRECT, INDEX, OFFSET as array function?

cristobal03

New Member
Joined
Jun 20, 2018
Messages
2
First post; I searched the forum and found threads that are pretty close but not quite right for what I'm trying to do.

I have a working function that is unnecessarily redundant, and I'm trying to convert it to an array function. Here is the raw:

Code:
=
SUM(
IF(NOT(ISERROR(OFFSET(INDEX(INDIRECT("'" & [COLOR=#0000ff]A3[/COLOR] & "'!5:5"),MATCH(summary_invoice_month,INDIRECT("'" & [COLOR=#0000ff]A3[/COLOR] & "'!5:5"),0)),row(INDIRECT("'" & [COLOR=#0000ff]A3[/COLOR] & "'!monthly_billable")) - 5,0))),OFFSET(INDEX(INDIRECT("'" & [COLOR=#0000ff]A3[/COLOR] & "'!5:5"),MATCH(summary_invoice_month,INDIRECT("'" & [COLOR=#0000ff]A3[/COLOR] & "'!5:5"),0)),row(INDIRECT("'" & [COLOR=#0000ff]A3 [/COLOR]& "'!monthly_billable")) - 5,0),0),
IF(NOT(ISERROR(OFFSET(INDEX(INDIRECT("'" & [COLOR=#ff0000]A4 [/COLOR]& "'!5:5"),MATCH(summary_invoice_month,INDIRECT("'" & [COLOR=#ff0000]A4 [/COLOR]& "'!5:5"),0)),row(INDIRECT("'" & [COLOR=#ff0000]A4 [/COLOR]& "'!monthly_billable")) - 5,0))),OFFSET(INDEX(INDIRECT("'" & [COLOR=#ff0000]A4 [/COLOR]& "'!5:5"),MATCH(summary_invoice_month,INDIRECT("'" & [COLOR=#ff0000]A4 [/COLOR]& "'!5:5"),0)),row(INDIRECT("'" & [COLOR=#ff0000]A4 [/COLOR]& "'!monthly_billable")) - 5,0),0),
IF(NOT(ISERROR(OFFSET(INDEX(INDIRECT("'" & [COLOR=#008000]A5 [/COLOR]& "'!5:5"),MATCH(summary_invoice_month,INDIRECT("'" & [COLOR=#008000]A5 [/COLOR]& "'!5:5"),0)),row(INDIRECT("'" & [COLOR=#008000]A5 [/COLOR]& "'!monthly_billable")) - 5,0))),OFFSET(INDEX(INDIRECT("'" & [COLOR=#008000]A5 [/COLOR]& "'!5:5"),MATCH(summary_invoice_month,INDIRECT("'" & [COLOR=#008000]A5 [/COLOR]& "'!5:5"),0)),row(INDIRECT("'" & [COLOR=#008000]A5 [/COLOR]& "'!monthly_billable")) - 5,0),0),
IF(NOT(ISERROR(OFFSET(INDEX(INDIRECT("'" & [COLOR=#800080]A6 [/COLOR]& "'!5:5"),MATCH(summary_invoice_month,INDIRECT("'" & [COLOR=#800080]A6 [/COLOR]& "'!5:5"),0)),row(INDIRECT("'" & [COLOR=#800080]A6 [/COLOR]& "'!monthly_billable")) - 5,0))),OFFSET(INDEX(INDIRECT("'" & [COLOR=#800080]A6 [/COLOR]& "'!5:5"),MATCH(summary_invoice_month,INDIRECT("'" & [COLOR=#800080]A6 [/COLOR]& "'!5:5"),0)),row(INDIRECT("'" & [COLOR=#800080]A6 [/COLOR]& "'!monthly_billable")) - 5,0),0),
IF(NOT(ISERROR(OFFSET(INDEX(INDIRECT("'" & [COLOR=#daa520]A7 [/COLOR]& "'!5:5"),MATCH(summary_invoice_month,INDIRECT("'" & [COLOR=#daa520]A7 [/COLOR]& "'!5:5"),0)),row(INDIRECT("'" & [COLOR=#daa520]A7 [/COLOR]& "'!monthly_billable")) - 5,0))),OFFSET(INDEX(INDIRECT("'" & [COLOR=#daa520]A7 [/COLOR]& "'!5:5"),MATCH(summary_invoice_month,INDIRECT("'" & [COLOR=#daa520]A7 [/COLOR]& "'!5:5"),0)),row(INDIRECT("'" & [COLOR=#daa520]A7 [/COLOR]& "'!monthly_billable")) - 5,0),0)
)

This is for an project management invoice tracking workbook (a contract burn rate calculator). Here's the basic idea:

  • Summary sheet that lists all the contracted vendors; contract value; spend to date; remaining; and estimated depletion
    • Summary sheet also has a helper field where I can put in a month (summary_invoice_month) and see the total billable for that month--this is where the above function fits in
  • One sheet for each contract
    • Summary info
    • Table for itemized contract resources (one row for each resource, w/ rate; total hours; billed hours; remaining hours; and monthly tally)
    • Table for itemized resource costs (monthly hours * rate) and total monthly billable (monthly_billable)
  • Additional relevant details
    • A3:A7 on the summary sheet is actually a named range called agency_order_nos
    • Row 5 in contract sheets contains month values as column headers, i.e. 5:5 is a series of months starting from contract execution to contract fulfillment--the monthly range will not be identical from one sheet to the next (thus the ISERROR in the conditional)
    • The bit about 'row(monthly_billable) - 5' is to account for differences between the number of line items from one sheet to the next, since I know row 5 is the starting point (the month headers)

Hopefully that all makes sense. I think it must be possible to do this as an array formula so I don't need to repeat the same expression five times for A3 through A7. I also think it probably isn't necessary to run the same expression in a conditional check and then again in the true part.

Help? Thanks!

chris
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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