I need some help creating a formula. I have an excel file with 3 columns and I need to sum values of column C, based on the unique values of column A even if I filter something in column B.
| Col A | Col B | Col C |
|---|---|---|
| AAA | A | 10 |
| AAA | A | 10 |
| BBB | B | 20 |
| BBB | B | 20 |
| CCC | C | 10 |
| DDD | D | 10 |
| DDD | D | 10 |
| EEE | A | 20 |
I achieved that using the formula:
=SUMPRODUCT((C8:C8/COUNTIF(A8:A8;A8:A8)))
Which gives me the result "70" but when I use filter in column B, the result is not updated. E.G. if I filter column B and choose to bring me only the "A" the result should be "30", but it remains "70".
Could you please help me?
Thanks in advance, Elias






If ms365 is applicable, try to utilize
SUBTOTAL()nested withinMAP():Formula in
E1:Option 1 for Excel 2016:
SUBTOTAL()in an helper column:OP's using ms Excel 2016, therefor he could also just apply the
SUBTOTAL(103,<ref>)to an helper column:Formula in
D2and dragged down:Formula in
F1:Option 2 for Excel 2016: Measure inside Power Pivot Table:
You could also apply a Power Pivot Table.
Select a cell from given table and on the 'Power Pivot' tab click to 'Add to Data Model';
If any pop-up opens, you can close this for now;
On the 'Power Pivot' tab now click 'Measures'>'New Measure';
On the window that opens, select the previously added table at the top, find a suitable name for your measure and use the following formula:
=SUMX(DISTINCT(Table1[Col A]),FIRSTNONBLANK(Table1[Col C],0))Click 'OK', then go back to the 'Power Pivot' tab to click 'Manage';
On the 'Home' tab now click to insert a PivotTable, choose a suitable place for the output;
Set ColA to rows, ColB to Filter and your measure to Values;
The output should look something like this:
Now instead of filtering your original data, filter cell
F1. You still have the option to select multiple options there.A more convoluted option perhaps.