Is there a way to remove duplicate in an formula?? Can you please assist on this formula

Jarodjp42

New Member
Joined
Nov 21, 2017
Messages
35
I only know of the way to remove duplicates by going to data tab and under data tools click remove duplicates. Is there a way to sum the total amounts of invoices and remove the duplicates?

Question: Calculate the total sum of the invoices. If there are duplicates invoices, only use the total 1 time?


[TABLE="width: 141"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Ivoice[/TD]
[TD]Totals[/TD]
[/TR]
[TR]
[TD]INV-000014[/TD]
[TD="align: right"]128[/TD]
[/TR]
[TR]
[TD]INV-000014[/TD]
[TD="align: right"]128[/TD]
[/TR]
[TR]
[TD]INV-000021[/TD]
[TD="align: right"]223[/TD]
[/TR]
[TR]
[TD]INV-000021[/TD]
[TD="align: right"]223[/TD]
[/TR]
[TR]
[TD]INV-000021[/TD]
[TD="align: right"]223[/TD]
[/TR]
[TR]
[TD]INV-000021[/TD]
[TD="align: right"]223[/TD]
[/TR]
[TR]
[TD]INV-000105[/TD]
[TD="align: right"]855[/TD]
[/TR]
[TR]
[TD]INV-000105[/TD]
[TD="align: right"]855[/TD]
[/TR]
[TR]
[TD]INV-000105[/TD]
[TD="align: right"]855[/TD]
[/TR]
[TR]
[TD]INV-000105[/TD]
[TD="align: right"]855[/TD]
[/TR]
[TR]
[TD]INV-000105[/TD]
[TD="align: right"]855[/TD]
[/TR]
[TR]
[TD]INV-000105[/TD]
[TD="align: right"]855[/TD]
[/TR]
[TR]
[TD]INV-000110[/TD]
[TD="align: right"]107[/TD]
[/TR]
[TR]
[TD]INV-000110[/TD]
[TD="align: right"]107[/TD]
[/TR]
[TR]
[TD]INV-000110[/TD]
[TD="align: right"]107[/TD]
[/TR]
[TR]
[TD]INV-000117[/TD]
[TD="align: right"]1546[/TD]
[/TR]
[TR]
[TD]INV-000117[/TD]
[TD="align: right"]1546[/TD]
[/TR]
[TR]
[TD]INV-000117[/TD]
[TD="align: right"]1546[/TD]
[/TR]
[TR]
[TD]INV-000117[/TD]
[TD="align: right"]1546[/TD]
[/TR]
[TR]
[TD]INV-000118[/TD]
[TD="align: right"]998[/TD]
[/TR]
[TR]
[TD]INV-000118[/TD]
[TD="align: right"]998[/TD]
[/TR]
[TR]
[TD]INV-000118[/TD]
[TD="align: right"]998[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Please try this. Your data needs to start in cell A1 where the header "Invoice" is in cell A1

=SUM(IF(IF(MATCH(A2:A23, A2:A23, 0)=(ROW(A2:A23)-ROW(A1)), (ROW(A2:A23)-ROW(A1)), 0)<>0, B2:B23, ""))
 
Upvote 0
Try this:

Excel Workbook
ABCD
1IvoiceTotals
2INV-000014128INV-000014256
3INV-000014128INV-000021892
4INV-000021223INV-0001055130
5INV-000021223INV-000110321
6INV-000021223INV-0001176184
7INV-000021223INV-0001182994
8INV-000105855
9INV-000105855
10INV-000105855
11INV-000105855
12INV-000105855
13INV-000105855
14INV-000110107
15INV-000110107
16INV-000110107
17INV-0001171546
18INV-0001171546
19INV-0001171546
20INV-0001171546
21INV-000118998
22INV-000118998
23INV-000118998
Sheet1
 
Upvote 0
Please try this. Your data needs to start in cell A1 where the header "Invoice" is in cell A1

=SUM(IF(IF(MATCH(A2:A23, A2:A23, 0)=(ROW(A2:A23)-ROW(A1)), (ROW(A2:A23)-ROW(A1)), 0)<>0, B2:B23, ""))

Thank you for the response, however I am getting an error code when I type in the formula. It is telling me I haven't satisfied the IF logical test. =SUM(IF(IF(MATCH(A2:A23, A2:A23, 0)=(ROW(A2:A23)-ROW(A1)), (ROW(A2:A23)-ROW(A1)), 0)<>0, B2:B23, "")) It puts the cursor between the two bold parentheses. Any thoughts?
 
Upvote 0
Try this:

Sheet1

ABCD
IvoiceTotals
INV-000014INV-000014
INV-000014INV-000021
INV-000021INV-000105
INV-000021INV-000110
INV-000021INV-000117
INV-000021INV-000118
INV-000105
INV-000105
INV-000105
INV-000105
INV-000105
INV-000105
INV-000110
INV-000110
INV-000110
INV-000117
INV-000117
INV-000117
INV-000117
INV-000118
INV-000118
INV-000118

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:105px;"><col style="width:64px;"><col style="width:93px;"><col style="width:90px;"></colgroup><tbody>
[TD="bgcolor: #cacaca, align: center"]1[/TD]

[TD="bgcolor: #cacaca, align: center"]2[/TD]

[TD="align: right"]128[/TD]

[TD="align: right"]256[/TD]

[TD="bgcolor: #cacaca, align: center"]3[/TD]

[TD="align: right"]128[/TD]

[TD="align: right"]892[/TD]

[TD="bgcolor: #cacaca, align: center"]4[/TD]

[TD="align: right"]223[/TD]

[TD="align: right"]5130[/TD]

[TD="bgcolor: #cacaca, align: center"]5[/TD]

[TD="align: right"]223[/TD]

[TD="align: right"]321[/TD]

[TD="bgcolor: #cacaca, align: center"]6[/TD]

[TD="align: right"]223[/TD]

[TD="align: right"]6184[/TD]

[TD="bgcolor: #cacaca, align: center"]7[/TD]

[TD="align: right"]223[/TD]

[TD="align: right"]2994[/TD]

[TD="bgcolor: #cacaca, align: center"]8[/TD]

[TD="align: right"]855[/TD]

[TD="bgcolor: #cacaca, align: center"]9[/TD]

[TD="align: right"]855[/TD]

[TD="bgcolor: #cacaca, align: center"]10[/TD]

[TD="align: right"]855[/TD]

[TD="bgcolor: #cacaca, align: center"]11[/TD]

[TD="align: right"]855[/TD]

[TD="bgcolor: #cacaca, align: center"]12[/TD]

[TD="align: right"]855[/TD]

[TD="bgcolor: #cacaca, align: center"]13[/TD]

[TD="align: right"]855[/TD]

[TD="bgcolor: #cacaca, align: center"]14[/TD]

[TD="align: right"]107[/TD]

[TD="bgcolor: #cacaca, align: center"]15[/TD]

[TD="align: right"]107[/TD]

[TD="bgcolor: #cacaca, align: center"]16[/TD]

[TD="align: right"]107[/TD]

[TD="bgcolor: #cacaca, align: center"]17[/TD]

[TD="align: right"]1546[/TD]

[TD="bgcolor: #cacaca, align: center"]18[/TD]

[TD="align: right"]1546[/TD]

[TD="bgcolor: #cacaca, align: center"]19[/TD]

[TD="align: right"]1546[/TD]

[TD="bgcolor: #cacaca, align: center"]20[/TD]

[TD="align: right"]1546[/TD]

[TD="bgcolor: #cacaca, align: center"]21[/TD]

[TD="align: right"]998[/TD]

[TD="bgcolor: #cacaca, align: center"]22[/TD]

[TD="align: right"]998[/TD]

[TD="bgcolor: #cacaca, align: center"]23[/TD]

[TD="align: right"]998[/TD]

</tbody>

Spreadsheet Formulas
CellFormula
C2{=INDEX($A$2:$A$23, MATCH(0, COUNTIF($C$1:C1, $A$2:$A$23), 0))}
D2{=SUM(IF(C2=$A$2:$A$23,$B$2:$B$23,0))}
C3{=INDEX($A$2:$A$23, MATCH(0, COUNTIF($C$1:C2, $A$2:$A$23), 0))}
D3{=SUM(IF(C3=$A$2:$A$23,$B$2:$B$23,0))}

<tbody>
</tbody>
Formula Array:
Produce enclosing
{ } by entering
formula with CTRL+SHIFT+ENTER!

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

Thank you for the response, but I am trying to put the formula into one cell and have it sum the amounts for the invoices.
 
Upvote 0
Shoot, I forgot to tell you to finish the formula as an array formula Ctrl-Shift-Enter. Do that when you are editing the formula
 
Upvote 0
Shoot, I forgot to tell you to finish the formula as an array formula Ctrl-Shift-Enter. Do that when you are editing the formula

Is there any way you can breakdown the formula and explain it to me. I would like to know why and how it works so I can use the functions in future formulas! Thanks!
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top