I'm attempting to calculate periods of out of stock for a fleet of rental equipment that has been in service for the past few years. I'm having trouble creating a sumif calculated field that sums units by date if date is between start and finish. My data looks like this:
Calendar |Start |Finish |Product |Units
2015-12-06|2015-12-6|2015-12-6 |Snowshoes |2
2015-12-07|2015-12-6|2015-12-7 |Snowshoes |1
Calendar - is a helper column I've added. It's sequential dates from launch to the present Start - is the start Date of a rental booking Finish - end date of the rental booking Product - What's being rented Units - How many are rented for that booking
I'd like the pivot table to look like:
Date | Snowshoes | Tent ... etc
2015-12-06 | 3 |
2015-12-07 | 1 |
I'm having a hard time setting up calculated field that will sum units if date is between start and finish, I keep getting formula errors.
Here's the formula I'm attempting to use to create a calculated field:
= sumifs( Units ,Start,">= Calendar" , Finish,"<= Calendar")
Is this even the best way to go about solving this problem? Is my formula the issue or is the entire approach flawed?
SUMPRODUCT
is probably the way to go. But for comparing inSUMIFS
, you will need to use">="&Calendar
and"<="&Calendar
instead. – ian0411=SUMIFS(Units,Start,">="&Calendar,Finish,"<="&Calendar)
or=SUMPRODUCT(Units,Start>=Calendar,Finish<=Calendar)
if I didn't twist my eyes typing here. Or try and then post the screenshot here so we can better assist you. – ian0411