Formula for total dependent on value of a cell

New Contributor


Is it possible to enter a formula that totals a column, but is dependent on another number in each row as to whether it is included in the total?


I have recreated a simple table to demonstrate my ask below….


I have a spreadsheet with many items relating to 2 cost centres (123456 and 654321), with a total at the end per cost centre and a total combined.


The formula i’d like would be that if a cost centre is changed from 123456 to 654321 (or vice versa), that the totals are able to identify this change automatically. Is there a formula that would cater for this please?



Kind regards


2 Replies
best response confirmed by Mazzarougle (New Contributor)



You can try this formula which is in cell B8 and filled across range B8:E9.


Amazing, thank you so much!!