I am trying to find the sum of a range/set of cells... if those cells meet two criteria.
I have two columns with specific dates:
start(J) end(K)
12/4/2017 12/10/2017
12/11/2017 12/17/2017
I have a date column with numerous dates:
Date
14-Dec-17
etc
and lastly a column with a value:
Value
12.5
What I want to achieve is if a cell under the date column is >= the start date and is <= to the end date in the same row. I want to take the value in the value column on the same row as the date and calculate the sum of the value cell data if the date data matches the criteria.
if ("date1" >= "start1" && "date1" <= "end1") than if true take cell value for "value1" in the same row as the "date1" and sum together all the values for dates that meet the criteria and return the sum.
That's the best I can think to explain what I am trying to achieve. I would like to do this using a formula if possible.
So the first formula I came up with is this:
=IF(AND(E$15:E$218>J15,E$15:E$218<K15),SUBTOTAL(9,H$15:H$218),0)
this returns zeros for every row except one and that one looks like if summed all the value in the "value" range and returned.
I am currently trying to see if I can use a SUMIFS formula with no luck yet.
Any suggestions on how I can or if its possible to achieve this using a formula. My data is also in a table if that makes a difference. I can put data in standard spreadsheet if needed.
any help would be greatly appreciated. Thanks in advance.
Solution as provided by Scott Craner:
Date Unit Value Daily EV Week Start Week End Weekly Total
14-Dec-17 0.57 1.71 12/4/2017 12/10/2017 0
14-Dec-17 0.65 0.65 12/11/2017 12/17/2017 2.36
in my case the daily EV is the "value" I wanted to sum if the "date" fell between "week start" and "week end"...."weekly total" being the sum of all "daily EV" values that fell between those dates
SUMIFS:
=SUMIFS(H$15:H$218,E$15:E$218,">" & J15,E$15:E$218, "<" & K15)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments