Thread: [Solved] The correct formula
View Single Post
 
Old 05-02-2023, 12:17 AM
ArviLaanemets ArviLaanemets is offline Windows 8 Office 2016
Expert
 
Join Date: May 2017
Posts: 873
ArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud of
Default

The formula you need to enter into cell D2 and then copy down is like (You have to edit the ranges when you have more or less rows in table. And be sure you have proper absolute/relative references used.):
Code:
=SUMIFS($C$2:$C$22,$B$2:$B$22,$B2)
The formula returns group total for every member row of group. It is possible to modify it so so group total is returned for only one row in every group, but instead I advice to have a sheet where all [BU ID]'s are registered, and add there a column with my formula. An added bonus is, you can use this table as source for Data Validation List in [BU ID] column in your table (by default, Data Validation List allows to enter/select only values present in it's source).

If you use defined Table instead regular one, the same formula will be something like
Code:
When used in same Table:
=SUMIFS([Payment Date],[BU ID],@[BU ID])

When used in Table where [BU ID]'s are registered:
=SUMIFS(YourPaymentsTable[[Payment Date]],YourPaymentsTable[[BU ID]],@[BU ID])

When you drop using spaces in your table headers (e.g. having headers like PaymentDate and BUID instead, e.g. the last formula simplifies as:
=SUMIFS(YourPaymentsTable[PaymentDate],YourPaymentsTable[BUID],@BUID)
An added bonus using defined Tables is, the formulas are adjusting automatically whenever any rows are added/removed. The only limiting condition for making this work is, that the whole column must have this (and only this) formula!
Reply With Quote