missilepilot
New Member
- Joined
- Jun 6, 2017
- Messages
- 8
So I need to compute the average number of days between two columns, with multiple instances of each start and end date, across multiple sheets, and only including cells that occur in a row with a matching value.
=AVERAGE(DAYS(IF(MATCH(B4,INDIRECT("'" &SHEETLIST& "'!$B3:$B300")),INDIRECT("'" &SHEETLIST& "'!$H3:$H300")),IF(MATCH(B4,INDIRECT("'" &SHEETLIST& "'!$B3:$B300")),INDIRECT("'" &SHEETLIST& "'!$E3:$E300"))))
Is where I'm at so far. SHEETLIST is the list of all sheets, looking for a match in B3:B300 of those sheets, and then comparing the distance between dates listed in H3:H300 and E3:E300 of those sheets, computing the average number of days utilizing those ranges, and returning it to a summary sheet. Column H will not always contain a date, in that case I want it to use today's date for determining time elapsed. I realize i'm getting close to the boundaries of what formulas are capable of, but my knowledge of VBS is limited. I am studying VBS, but i need to complete this workbook in a timely fashion. Any help would be greatly appreciated.
<colgroup><col style="width:59pt" width="79"> <col style="width:128pt" width="171"> <col style="width:95pt" width="126"> <col style="width:93pt" width="124"> <col style="width:56pt" width="75"> <col style="width:113pt" width="150"> <col style="width:72pt" width="96"> </colgroup><tbody>
</tbody>
=AVERAGE(DAYS(IF(MATCH(B4,INDIRECT("'" &SHEETLIST& "'!$B3:$B300")),INDIRECT("'" &SHEETLIST& "'!$H3:$H300")),IF(MATCH(B4,INDIRECT("'" &SHEETLIST& "'!$B3:$B300")),INDIRECT("'" &SHEETLIST& "'!$E3:$E300"))))
Is where I'm at so far. SHEETLIST is the list of all sheets, looking for a match in B3:B300 of those sheets, and then comparing the distance between dates listed in H3:H300 and E3:E300 of those sheets, computing the average number of days utilizing those ranges, and returning it to a summary sheet. Column H will not always contain a date, in that case I want it to use today's date for determining time elapsed. I realize i'm getting close to the boundaries of what formulas are capable of, but my knowledge of VBS is limited. I am studying VBS, but i need to complete this workbook in a timely fashion. Any help would be greatly appreciated.
CUST ID # | NAME | SALES | INVOICE DUE DATE | AMOUNT | REASON | DATE COMPLETE |
1234 | John Doe | Dr. Dre | 7/1/2017 | $3.50 | Other | 7/18/2017 |
1234 | Jane Doe | Dr. Dre | 7/1/2017 | $3.50 | Mismatch | |
<colgroup><col style="width:59pt" width="79"> <col style="width:128pt" width="171"> <col style="width:95pt" width="126"> <col style="width:93pt" width="124"> <col style="width:56pt" width="75"> <col style="width:113pt" width="150"> <col style="width:72pt" width="96"> </colgroup><tbody>
</tbody>