# Conditional Running total - only sum once when Invoice number changes

#### Lynn KG

##### New Member
I have a worksheet with sales of items by invoice number. Each item is a separate row, so there can be several rows with the same invoice number. I need to total sales for each invoice, only when the invoice number changes.

Invoice number in Column A, Ext. Price amount in column E, Shipping amount in column F and invoice total in G.
right now I put in a formula for each invoice. How can I automate this so when the Invoice number changes, It sums the of Ext. Price & Shipping for all rows with that invoice #.

invoice# Item Units Price Ext. Price Shipping Total
41280 1063F 3 \$75.00 225.00 - 225.00
41281 1090F 2 \$10.00 20.00 -
41281 1098F 1 \$25.00 25.00 -
41281 3028F 4 \$25.00 100.00 30.00 175.00
40416 1200F 1 \$25.00 25.00 -
40416 6071F 2 \$10.00 20.00 -
40416 1081F 3 \$25.00 75.00 - 120.00
41291 4030F 1 \$25.00 25.00 -
41291 4029F 1 \$30.00 30.00 40.00 95.00
545.00 70.00 615.00
THANKS!

Last edited:

### Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

#### Andrew Poulsom

##### MrExcel MVP
Welcome to MrExcel.

Have you tried eg?

=IF(A2<>A3,SUMIF(A:A,A2,G:G),"")

#### Lynn KG

##### New Member
Welcome to MrExcel.

Have you tried eg?

=IF(A2<>A3,SUMIF(A:A,A2,G:G),"")

Awesome! Thank you!!
Is it possible to sum both Column G and Column F, the Ext Price and Shipping?

#### Andrew Poulsom

##### MrExcel MVP

=IF(A2<>A3,SUM(SUMIF(A:A,A2,E:E),SUMIF(A:A,A2,F:F)),"")

#### Lynn KG

##### New Member
Works like a Dream. You made my Day!
Thanks!!!!

Replies
2
Views
232
Replies
2
Views
4K
Replies
5
Views
4K

1,191,118
Messages
5,984,749
Members
439,907
Latest member
Kayfabe

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back