Link to home
Start Free TrialLog in
Avatar of agwalsh

asked on

Create a formula that calculates the sum of a range based on matching to a date

How can I set up a formula that calculates a total from a range based on matching a date from a dropdown. I've been experimenting with Sumifs but can't get it to work.. In the attached file I have entered what I want the answer to be depending on what I choose from the list. Thank you as always.
Avatar of Rob Brockett
Rob Brockett
Flag of New Zealand image


This could be accomplished using Offset, which is a volatile function, but my preference is to use Index which isn't volatile.

When your headers are limited to 12 months for the year beginning in January you can use:

Open in new window

If your headers could extend for more than 12 months, or if the financial year could start in a different month, it may be more robust to match the date in the dropdown against the headers:

Open in new window

Should work with sumif easily enough.

=SUMIF(DateColumn, Dropdown, ValueColumn)


Where D1:D5 is the range of dates
E1 is the dropdown
C1:C5 is the range you want to sum (which is aligned with the corresponding dates in D1:D5)

May be awkward with dates as cells can be formatted differently, or date formats can differ. best to set these cells to a specific date format to ensure they match up.
Avatar of Roy Cox
Roy Cox
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of agwalsh


Thank you to all of the experts here AKA as "the Excel cavalry" :-)
Pleased to help