# Thread: Sum on Max value in repeated data

1. ## Sum on Max value in repeated data

Hi All

Referring the table below, I wish to sum total invoice value on the line where invoice is ending. Each invoice number has line numbers and sum formula should be applicable only on last line/max line of each invoice. Kindly suggest.

 Inv Number Line No Value Sum by Invoice 316 1 \$500 316 2 \$215 317 1 \$452 317 2 \$125 317 3 \$521 317 4 \$124 318 1 \$150

Thanks
Sats

2. There are built-in facilities for this sort of thing.
In the attached Sheet1 there's Outline|Subtotal, see:
Outline (group) data in a worksheet - Excel
https://support.microsoft.com/en-us/...7-8278c49e9aff
Insert subtotals in a list of data in a worksheet - Excel
https://support.microsoft.com/en-us/...e-b0a3d4a52b3a

and on Sheet2 you can create a Pivot table in 30 seconds.

3. Hi

Assuming your data is in A1:C8, in D2 place the following and copy down.

=IF(A2<>A3,SUMIF(\$A\$2:\$A\$8,A2,\$C\$2:\$C\$8),"")

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•