SUM and SUBTOTAL unique product item list

MYUSERNAMEIS

New Member
Joined
Jan 4, 2017
Messages
4
Hello,
I want to get a sum of prices for column AA, but only counting 1 occurrence of each individually named Item in column U - for example if the formula worked it would return £16 in AA42 - it would ignore duplicate Supplier Item Names (Row U)
There are some filtered out rows which I do not want to be counted.
Cells in columns X and ZZ contain formula that refer to other cells elsewhere in the spreadsheet.
Any help would be greatly appreciated.


I have previously had great help from this forum, the help I got last year was perfect - but my spreadsheet has evolved a lot since then, and the formula is not suited to what I want it to do now, I have tried tweaking it, but as an excel novice I don't know what I am doing and am getting nonsensical results.

Here is the previous thread;
https://www.mrexcel.com/forum/excel-...ered-list.html

ColumnTUVWXYZAA
Row No.SUPPLIERSUPPLIER Item NameSUPPLIER Item CodeSUPPLIER price / packNO. to ORDERP+PCost / Supplier Unit Ex VATTOTAL ex VAT
24amazon4 Digit Combination PadlockDesired tools£1.002.00£0.00£1.00£2.00
25Ebay1 minute sand egg timern/a£2.001.00£0.00£2.00£2.00
26Ebay1 minute sand egg timern/a£2.001.00£0.00£2.00£2.00
38Amazon100 disposable 7" white Plastic PlatesBest Values£3.001.00£3.00£3.00£3.00
39Amazon100 disposable 7" white Plastic PlatesBest Values£3.001.00£3.00£3.00£3.00
40aladdin100 x skewers in bamboo 250mmn/a£4.001.00£0.00£4.00£4.00
41Amazon1000 Paper 50mm Diameter Round Mixed Colour Code StickersLabelWonderland£5.001.00£0.00£5.00£5.00
£16.00

<tbody>
</tbody>
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Formula in cell AA42:

=SUMPRODUCT(AA24:AA41/COUNTIF(U24:U41,U24:U41))

Thank you for such a quick reply!
I think this is getting close, however it seems to be including values that are hidden or filtered out - is there a way to only include visible cells?
Thank you for your help
 
Last edited by a moderator:
Upvote 0
You could use a helper column that tells the formula if the value is hidden.
Formula in cell AB24:
=SUBTOTAL(103,AA24)
Copy cell AB24 and paste to cells below.


Formula in cell AA42:
=SUMPRODUCT((AA24:AA41*AB24:AB41)/COUNTIFS(U24:U41,U24:U41,T24:T41,T24:T41)
 
Last edited:
Upvote 0
Control+shift+enter, not just enter:

=SUM(IF(FREQUENCY(IF(SUBTOTAL(103,OFFSET($U$24,ROW($U$24:$U$41)-ROW($U$24),0,1)),IF(LEN($U$24:$U$41)>0,MATCH($U$24:$U$41,$U$24:$U$41,0))),ROW($U$24:$U$41)-ROW($U$24)+1),$AA$24:$AA$41))
 
Upvote 0
Ctrl+shift+enter
=sum((match(u24:u41,u24:u41,)=row(u24:u41)-23)*(subtotal(3,offset(u23,row(u24:u41)-23,))=1)*aa24:aa41)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,030
Messages
6,122,762
Members
449,095
Latest member
m_smith_solihull

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