#### Angliojoe

##### Board Regular
Hello All,

I am very new to the site and was hoping you can help as Ive been trying to solve this problem for the last two hours

I have a sheet with two columns (Below) one has cart id (that is duplicated for each product sold) and in the next coloum I have the revenue generated (Not every product generates revenue hence the -). I really need a third coloumn that gives me the total revenue generated per cart but I have no idea of what formula to use?

Cart id Revenue Total revenue
AAGGB -
AAGGB £46
AAGGB -
AAGGB £22
ASDA -
ASDA £21
AEDC £33
AFRT £44
ASFF £55
ASFF -

If anyone could help I would really appreciate it,

Joe.

### Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Try like this - formula in C2 copied down

Excel Workbook
ABC
1IDTotal
2AAGGB-68
3AAGGB4668
4AAGGB-68
5AAGGB2268
6ASDA-21
7ASDA2121
8AEDC3333
9AFRT4444
10ASFF5555
11ASFF-55
Sheet6

Thank you so much! As i'm relatively new to excel could you just explain to me how the formula does what it does?

Thanks again,

Joe.

SUMIF works like this

=SUMIF(range1,value,range2)

It adds together the values in range2 where the corresponding row in range1 equals the value.

Thanks!

Or use a pivot table.

Hi,

Just a qick question about the formula above. Is there anyway of doing it so the sum is only displayed once rather than on each line. For example;

ACCB £10 £15
ACCB
ACCB £5

Thanks,

joe.

Hi Joe,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
I would use a pivot table in this case. You would get is a table with one row per ID with that ID’s total revenue.<o></o>
But if you only want to change the formulas in your worksheet you could try:<o></o>
C2: =IF(COUNTIF(\$A\$2:A2,A2)=1;SUMIF(\$A\$2:\$A\$11,A2,\$B\$2:\$B\$11),"") <o></o>
and then copied down.

Replies
0
Views
247
Replies
3
Views
184
Replies
7
Views
209
Replies
1
Views
155
Replies
4
Views
292

1,202,962
Messages
6,052,815
Members
444,602
Latest member
Cookaa

### 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