Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Returning SUM, ignoring column duplicates

I have 2 columns in a Google Sheet

C = order number

N = shipping cost

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

If a customer order has more than one line item, the order number & shipping cost are listed twice — but I just need to sum the "unique" shipping cost, ignoring the duplicate line entries

COLUMN C COLUMN N
Order1 £10.00
Order1 £10.00
Order1 £10.00
Order2 £5.00
Order3 £5.00

My expected result from the sample above would be £20.00.
Order 1 was £10 postage, Order 2 was £5, Order 3 was £5.

I can get this to work using =UNIQUE(C3:C) in a helper column then doing VLOOKUP(N1, C3:N, 12, FALSE) — then summing that but I was hoping to have one formula in one cell (C1)

>Solution :

Here is a formula that should work for you:

=sum(iferror(arrayformula(VLOOKUP(unique($C$3:$C), $C$3:$N, 12, 0))))

You had all the pieces, they just needed to be put together.

ex

Please let me know if you have any issues with this

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading