Good afternoon,
Urgently seeking assistance with the attached spreadsheet as I have so far failed to resolve the totals need in columns AA:AG.

This is a visit schedule and I am trying to keep track of the number of times each of those officers PP-DMar 'attend' those locations in column C & O

In the summary part (AA3:AG49) The rows are split in to two groups - the first group (Local units) is numbered 29-705, the second group (Provinces, 'L&R', 'SUR' etc)

I am trying to total up the number of times 'PP', 'SP' ....'Dep2' have entries in columns D..K and P...W for each numbered unit (Columns C & O) and each Province.

Three manual entries as an example - only non-blank cells are counted as a value represents a visit of some kind.

PP 'Visits' Unit No 29 twice (via column D) and never via column P

PP 'Visits' Unit No 514 twice (via column D and once via column P

SP 'Visits' '258' twice (via column 2), '514' once and 'BRI' once via column P

When completed, the counts should balance with the summary in cells P58:W58

Help will be appreciated, getting short of time (as usual)