Getting the amounts for each provider is as simple as:
=SUMIF(A2:A20,A2,J2:J20)
where 20 is the last data row. Note that this does not require the data to be sorted.
Doing the same for the units is equally straightforward. What is not apparent from your post is whether the 24 is to be deducted from each provider's unit count or only the ones for whom there is a unit value of 24, or if the deductible varies by provider.
For provider 001, the formula is:
=(SUMIF(A2:A20,A2,J2:J20)/SUMIF(A2:A20,A2,I2:I20))*(SUMIF(A2:A20,A2,I2:I20)-24)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
|