HI Ian.
I think The linked solution provides a good stepping off place for what's needed here. The table there depends on a column of checkboxes to create an index. Here the index could be created from a count of the item names to mark the first appearance of each on the daily log. As the item numbers are actual numbers, they can be used as the index values, and doing so will enable listing them in order by item number on the summary table usng SMALL to retrieve them in order). Once on the list, SUMIF will calculate the number of times each task was done that day.
Here's an example, using the Daily Record Input table as designed by Ian, and a new Summary table.
Columns A, B and C of Daily Record are filled by the user. Columns D and E are flled from the Database table (see Ian's earlier post) using one of the Lookup functions. Column E is calculated from the values in columns C and E, as described in Ian's earlier post.
Column G (Index) creates an index, using a formula to mark mark the first appearance of each item code in column B of the Daily Report table with the item number. All other rows in this column are filled with a number larger than any of the items numbers.
G2, and filled down: =IF(COUNTIF($B$2:B2,B)=1,B,999999)
Column G is needed for the operation of the Summary table, but is not needed by the user. This column may be hidden.
The summary table contains no entered data. Header labels for each column, and the Total label in the Footer row are the only items entered directly. The rest is filled by a set of formulas. All are entered in row 2 of their respective columns, and are filled down from there to the end of the body of the table.
A2: =IF(ROW()-1>COUNTIF(Daily Record Input :: G,"<999999"),"",SMALL(Daily Record Input :: G,ROW()-1))
This collects the item numbers for the tasks recorded on the daily record. SMALL is used to order these numbers from smallest to largest. The IF part is a switch that shuts off the calculation when the last item number has been copied to this table.
All of the following use IF(LEN(A) to check for content in column A of Summary, and prevent further calculation in none is found.
B2: =IF(LEN(A)<1,"",SUMIF(Daily Record Input :: B,A,Daily Record Input :: C))
If column A is filled on this row, this calculates the number of times the task coded in this row was performed this day.
C2: =IF(LEN(A)<1,"",LOOKUP(A,Daily Record Input :: G,Daily Record Input :: D))
D2: =IF(LEN(A)<1,"",LOOKUP(A,Daily Record Input :: G,Daily Record Input :: E))
These lookup the description and unit value associated with the task coded in column A. They are pointed at the Daily Record table as I did not construct a copy of the Database table. In practice, I would point this formula to the Database table where the original data is stored.
E2: =IF(LEN(A)<1,"",B*D)
This does the same calculation as the similar formula on the Daily Record table, but uses the total number of times each task was performed.
E11: =SUM(E)
Row 11 is a Footer row, and is excluded from calculations specifying a 'whole column' reference. The formula calculates the total number of units listed in column E.
Regards,
Barry